WolfireGames / overgrowth

Open Source codebase of the game Overgrowth by Wolfire Games LLC
Apache License 2.0
2.51k stars 260 forks source link

Compiletime reduction #53

Closed feliwir closed 2 years ago

feliwir commented 2 years ago

Run some clang compile time analysis and try to reduce some of the hotspots found (only the low hanging fruits). There are some other things i'll look out for and try to reduce. The are the principles i applied:

These are the numbers i get for a full compile using ninja on an AMD Ryzen 7 1800X Before After
read 2m41,982s 2m24,437s
user 36m57,585s 34m13,440s
sys 1m25,232s 1m18,250s

If someone is interested in a good read about the tools i've used: https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-profiler-for-Clang/ https://aras-p.info/blog/2019/09/28/Clang-Build-Analyzer/

codectile commented 2 years ago

Unity builds might help as well.

feliwir commented 2 years ago

Unity builds might help as well.

They usually decrease incremental build time by a lot, which is not desirable in my opinion

autious commented 2 years ago

I believe this merge broke the build for win64


D:\buildbot\wolfire-dev\overgrowth-build-win64\build\Source\Internal\datemodified.cpp(76): error C3861: 'ctime_s': identifier not found [D:\buildbot\wolfire-dev\overgrowth-build-win64\build\Build\OvergrowthWorker.vcxproj]```
feliwir commented 2 years ago

@autious which VS version are you using? Our CI runner uses VS2022, which defaults to win64 and that one compiled succesfully

autious commented 2 years ago

I believe it is vs2017

feliwir commented 2 years ago

@autious is it fixed by including <time.h>?