Commit Graph

3 Commits

Author SHA1 Message Date
henrik karlsson
4feb09e0b3 Compile time optimizations Managed to reduce unnamed game's biggest file compiler frontend cost from 113 seconds to 60 seconds. This also impact other things such as pch size and memory footprint when compiling which is great.
Takeaways. Try to use "friend" on functions/operators that are frequently overloaded EXCEPT if they are in a templated type that is frequently instantiated. So do not put friends in TMap, TSet, TObjectPtr etc, this will slow down compile times. There is a break-even somewhere and hard to tell where it is but taking a class that is templatized on character type probably don't matter either way and then it is nicer to use a friend since that simplies error messages when compiler can't resolve functions/operators.

If it is possible to use member functions instead of friend that is the best option in terms of compile time performance. With c++20 you only have to write operator==(Foo, Bar) and the compiler will automatically provide operator==(Bar, Foo), operator!=(Foo, Bar) and operator!=(Bar, Foo).

Changes in this changelist involes
* Making operator<< friends in non-template types and not friends in template types
* Making operator==/!= members where possible and if not possible moved out if type is a frequently instantiated templated type.

#preflight 636970f5376a9cd6a80da54a
#rb steve.robb

[CL 23038965 by henrik karlsson in ue5-main branch]
2022-11-08 15:59:46 -05:00
Devin Doucette
090bdb178e DDC: Fixed a missing include in DerivedDataBuildVersion.h
#rb trivial
#rnx

[CL 16883233 by Devin Doucette in ue5-main branch]
2021-07-19 10:10:26 -04:00
Devin Doucette
a282ee100c DDC: Added FBuildVersionBuilder as a standard way to create build versions
#rb Zousar.Shaker
#rnx

[CL 16855837 by Devin Doucette in ue5-main branch]
2021-07-14 17:35:03 -04:00