-
Notifications
You must be signed in to change notification settings - Fork 445
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
Investigate use of precompiled headers #5032
Comments
@vlstill @fruffy @ChrisDodd For W/o PCH:
With PCH:
|
And the differences for
vs
|
Here is full compilation after .def change (w/o Tofino of course): w/o PCH:
with PCH:
So, the wall-time difference is "just" 30 seconds, but this is due to 10 cores used to build. Note the 25% reduction in This is with clang on Mac OS, YMMV, need to check gcc on Linux :) |
One important thing: if one is switching between the branches frequently and rely on ccache, then the overall compile time might increase as PCH is effectively forces re-compilation in such a case. |
In case the compile-time impact is high, how does this change compare to enabling LTO in the build? What I remember from Tofino days, we had rather significant speedup by enabling LTO, presumably exactly because it allows inlining more functions. The advantage is that LTO can be enabled only for release builds so normal development build speeds are not affected.
On a slight tangent, there was an idea of speeding up compilation by using PCH (precompiled header in GCC/clang) for
ir-generated.h
. As far as I know, it was never tried and it was not completely clear if it was doable, but maybe it is worth investigating for the compilation speed (I don't think C++ modules will "save" us in in any reasonably close future giving their current state and more importantly the tool support state and requirements for P4C build).Originally posted by @vlstill in #5030 (comment)
The text was updated successfully, but these errors were encountered: