On Mon, 26 Oct 2026 22:23:12 GMT, Benjamin Peterson <[email protected]> 
wrote:

> Add `-fpch-instantiate-templates` to the clang precompiled header generation 
> command.
> 
> Testing with `make hotspot`, I observe a 40% reduction in build CPU time for 
> a release build. On a 56 core machine, this reduces the wall time of the same 
> command by 25% (45.94s -> 34.5s).
> 
> 
> 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

I believe it's already true that a build with precompiled headers can fail 
while a build without precompiled headers can succeed and vice versa?

I saw a GCC patch for `-fpch-instantiate-templates` was submitted last week. 
Assuming it's even accepted, though, it'll take years to be generally available.

My understanding is that MSVC's precompiled header implementation has a 
behavior equivalent to `-fpch-instantiate-templates`. So, the JDK is already 
exposed to this flavor of PCH.

As you say, I also observed that the `access*` files weigh heavily on 
compilation time. This flag is certainly the low hanging fruit.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/33576#issuecomment-6442519490

Reply via email to