On Mon, 19 Oct 2026 23:29:33 GMT, Benjamin Peterson <[email protected]> wrote:
> For every spawn, GNU make iterates all variables to find the exported ones. > The JDK build has many variables and many spawns, so a significant fraction > of make's CPU time is iterating variables during a JDK build. > > This change undefines variables from two frequently used macros, > SetupNativeCompilationBody and CreateCompiledNativeFileBody, after the > variables are no longer needed. > > This simple change removes 60% of the variables from the JtregNativeHotspot > submake and 55% of make variables from the hotspot submake. Overall, this > saves 38% of make CPU time on a clean build to run one jtreg test. > > > > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Thank you for looking. I was stimulated to look at this because I noticed periods of many seconds in both the hotspot and test submake steps, where `make` was dispatching many, small fast tasks (`nm` or `rm`). In such periods, the CPU spent on `make` far exceeded the CPU spent on actually building. I also have not noticed dramatic wall time improvement. But it seemed like a simple enough change to put up and solicit opinions on. ------------- PR Comment: https://git.openjdk.org/jdk/pull/33454#issuecomment-6301577773
