Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Precompiled Headers for faster compilation #126

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

danielkrupinski
Copy link

@danielkrupinski danielkrupinski commented Jun 25, 2021

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

@rollraw
Copy link
Owner

rollraw commented Jun 25, 2021

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?

@danielkrupinski
Copy link
Author

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

@techzin
Copy link

techzin commented Jun 25, 2021

Daniel always improving wherever he goes.

@master-of-darkness
Copy link

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

@rollraw rollraw added this to the v2.0 milestone Aug 2, 2022
@rollraw rollraw removed this from the v2.0 milestone Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants