RFR: 8329431: Improve speed of writing CDS heap objects [v4]

Ioi Lam iklam at openjdk.org
Wed Apr 10 04:17:27 UTC 2024


> [1] Change fixed sized ResourceHashtable used by CDS heap object dumping to ResizeableResourceHashtable. Before, the ArchivedObjectCache table has only 36k buckets. When running the LotsOfClasses.java test, this table would contain 721751 entries, so each bucket will have 200 entries. After the fix, the table will automatically expand so that each bucket will have about 8 entries.
> 
> [2] ArchiveHeapWriter::sort_source_objs() used to do O(N*logN) lookup in ArchivedObjectCache (each lookup computes the "rank" of the object). Now the rank is computed once for each object, so the lookup has been reduced to O(N).
> 
> [3] I also fixed TestCommon.findAllClasses() -- it used to try to recurse on even the non-directory entries. This causes 1 exception for each class in the jrt:// file system. Now we recurse only on directory entries.
> 
> On my machine, the execution time of LotsOfClasses.java reduced from 40 seconds to 27 seconds.

Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:

  added comment that the initial sizes are prime numbers

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/18572/files
  - new: https://git.openjdk.org/jdk/pull/18572/files/fe2d9e4a..e1577ebd

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=18572&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=18572&range=02-03

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

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


More information about the hotspot-runtime-dev mailing list