RFR: 8290466: Default to --with-source-date=current to avoid unmodified Hotspot recompilation

Erik Joelsson erikj at openjdk.org
Tue Jul 26 17:12:21 UTC 2022


On Tue, 26 Jul 2022 12:28:41 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> See the bug for symptoms and rationale.
> 
> In short, after [JDK-8288396](https://bugs.openjdk.org/browse/JDK-8288396) moved the timestamp to `CFLAGS_VM_VERSION` macro, which changes with every build, we get Hotspot recompilation every time, even when Hotspot is not modified.
> 
> I believe current behavior is correct for `--with-source-date=updated` (current default): you do Hotspot build, you get updated build timestamp, which forces recompilation of affected compilation units, relinkage, re-creation of jmods/jimage. The way out is to switch to `--with-source-date=current`, which would only get the build timestamp at configure time.
> 
> CIs and build farms are likely reconfiguring before every build anyway, so their behavior is unlikely to be affected. But this switch definitely improves the day-to-day OpenJDK development work: it saves >50 seconds on every `make` for my machine, see below.
> 
> Back-to-back unmodified build before:
> 
> 
> $ CONF=linux-x86_64-server-release time make hotspot
> Building target 'hotspot' in configuration 'linux-x86_64-server-release'
> Finished building target 'hotspot' in configuration 'linux-x86_64-server-release'
> 
> 39.03user 10.97system 0:56.89elapsed 87%CPU (0avgtext+0avgdata 2048944maxresident)k
> 363616inputs+4108072outputs (484major+1100154minor)pagefaults 0swaps
> 
> $ CONF=linux-x86_64-server-release time make hotspot
> Building target 'hotspot' in configuration 'linux-x86_64-server-release'
> Finished building target 'hotspot' in configuration 'linux-x86_64-server-release'
> 
> 38.18user 9.02system 0:49.18elapsed 95%CPU (0avgtext+0avgdata 2048788maxresident)k
> 40inputs+4101112outputs (0major+1100077minor)pagefaults 0swaps
> 
> 
> Back-to-back unmodified build after:
> 
> 
> $ CONF=linux-x86_64-server-release time make hotspot
> Building target 'hotspot' in configuration 'linux-x86_64-server-release'
> Finished building target 'hotspot' in configuration 'linux-x86_64-server-release'
> 
> 2.15user 0.22system 0:02.59elapsed 91%CPU (0avgtext+0avgdata 49480maxresident)k
> 0inputs+176outputs (0major+55506minor)pagefaults 0swaps
> 
> $ CONF=linux-x86_64-server-release time make hotspot
> Building target 'hotspot' in configuration 'linux-x86_64-server-release'
> Finished building target 'hotspot' in configuration 'linux-x86_64-server-release'
> 
> 2.18user 0.14system 0:02.46elapsed 94%CPU (0avgtext+0avgdata 49332maxresident)k

Marked as reviewed by erikj (Reviewer).

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

PR: https://git.openjdk.org/jdk/pull/9638



More information about the build-dev mailing list