RFR: 8293017: Improve hash calculation parallelism in jmod/jlink [v2]

Aleksey Shipilev shade at openjdk.org
Mon Aug 29 10:41:13 UTC 2022


> `jmod`/`jlink` are executed during build time to produce the `jmod` and the base modules image. On slow hardware (Raspberry Pi -class, for example) and/or slow VMs (debug, interpreter-only, for example) this takes a while. Profiling shows the considerable time is spent on hashing modules either for writing out the ModuleHash attribute or for verifying the hashes are good.
> 
> Those paths can be parallelized to make them quite faster.
> 
> The major contributors to module hashing are `java.base`, `jdk.desktop` and `jdk.localedata`, so we have a significant opportunity for parallelism here. 
> 
> Motivational improvements on `make clean-images images`:
> 
> 
> # x86_64 Server, release
> 
> # Baseline
> real	0m11.895s
> user	1m4.526s
> sys	0m10.715s
> 
> # Patched
> real	0m10.701s   ; <--- 1.1x improvement
> user	1m5.097s
> sys	0m11.260s
> 
> # x86_64 Zero, release
> 
> # Baseline
> real	5m20.335s
> user	7m7.791s
> sys	0m7.258s
> 
> # Patched
> real	2m23.551s  ; <--- 2.23x improvement
> user	7m14.442s
> sys	0m7.856s
> 
> 
> Additional testing: 
>   - [x] Linux x86_64 fastdebug, `java/util/jar`
>   - [x] Linux x86_64 fastdebug, `tools/jmod`
>   - [x] Linux x86_64 fastdebug, `tools/jlink`
>   - [x] Linux x86_64 fastdebug `tier1`

Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:

  Touchups

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/10060/files
  - new: https://git.openjdk.org/jdk/pull/10060/files/877ff17d..2389fdfd

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10060&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10060&range=00-01

  Stats: 5 lines in 2 files changed: 0 ins; 2 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/10060.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10060/head:pull/10060

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


More information about the core-libs-dev mailing list