Add precompiled header for kernel libraries (~11.85% faster build)#612
Open
Omotola wants to merge 1 commit into
Open
Add precompiled header for kernel libraries (~11.85% faster build)#612Omotola wants to merge 1 commit into
Omotola wants to merge 1 commit into
Conversation
Profiling with vcperf showed kernels/common/default.h is the most expensive included header, parsed in every kernel translation unit and transitively pulling in platform.h, intrinsics.h, windows.h and heavy STL headers. Precompile it once per ISA target via target_precompile_headers. Measured on a full clean rebuild (5 runs each, MSVC, Release): baseline: 1898.5s (sd 17.05) post PCH: 1673.5s (sd 17.45) -> 11.85% faster Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 78e85f7d-912f-4a77-9a1c-3c4f0316d659
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.
Summary
Adds a precompiled header (PCH) for the Embree kernel libraries to reduce build time.
Motivation
kernels/common/default.his included by nearly every kernel translation unit and transitively pulls inplatform.h,intrinsics.h,thread.h,mutex.h,windows.hand heavy STL headers (e.g.<memory>). Parsing it once per translation unit is a significant, repeated cost.Change
Use
target_precompile_headers()to precompiledefault.honce per ISA target (embree,embree_sse42/avx/avx2/avx512). Each target builds its own PCH with that target's flags.Measured impact
Full clean rebuild, MSVC, Release, 5 runs each:
~225 s faster (11.85%).
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com