[Code] Optimize PCH Config (Faster Builds)#4951
Merged
Conversation
KimLS
approved these changes
Jun 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is based off of efforts to cleanup the codebase, modernize and make it more efficient.
I have a branch called
build-analyzethat runs a trace of what takes up all of the build time (example here http://drone.akkadius.com/EQEmu/Server/18259/1/2)The headers in zone included in PCH are some of the most commonly included and biggest sources of compile time overhead.
This PR enables application level PCH for Linux builds, does not utilize STD library PCH's for Linux as it slows down builds significantly and ccache handles standard library caching better. For application level headers, it has shown a 17-30% improvement in benchmarks.
Type of change
Testing
Linux (16c/32t Intel)
Command Used
rm -rf ~/.ccache/* && ninja clean && time ninja -j$(expr $(nproc) - 2)
Master (Current)
1m36.088s
With app PCH
1m19.157s
1m20s
Checklist