qo0-csgo icon indicating copy to clipboard operation
qo0-csgo copied to clipboard

Enable Precompiled Headers for faster compilation

Open danielkrupinski opened this issue 3 years ago • 4 comments

This PR improves compilation times. Results of a clean build on a 4-core CPU:

  • Release:
    • before: 56531 ms
    • after: 32473 ms
  • Debug:
    • before: 39149 ms
    • after: 13188 ms

Here are inclusion times of headers after this PR (for further compilation speed improvements): image

danielkrupinski avatar Jun 25 '21 13:06 danielkrupinski

hey Daniel, good job. one thing i care about is visual studio bug when cheat could be compiled wrong and only after full recompilation will be fine. it's caused by cached obj files, so did you experience smth similar with precached headers? btw what you used to benchmark it?

rollraw avatar Jun 25 '21 15:06 rollraw

Generally you precompile headers that are unlikely to change often (e.g. standard library, Windows headers) and also PCH files are different from OBJ files, so I think that won't be the case here. For measuring build times: https://stackoverflow.com/questions/82128/displaying-build-times-in-visual-studio For the analysis I used vcperf and Windows Performance Analyzer - here is the guide https://docs.microsoft.com/en-us/cpp/build-insights/tutorials/vcperf-and-wpa?view=msvc-160

danielkrupinski avatar Jun 25 '21 17:06 danielkrupinski

Daniel always improving wherever he goes.

techzin avatar Jun 25 '21 19:06 techzin

I think It bad idea because VS 2019 has many bugs. So I had many problems with includes on my experience

master-of-darkness avatar Oct 27 '21 08:10 master-of-darkness