RFR: 8329431: Improve speed of writing CDS heap objects [v3]
Ioi Lam
iklam at openjdk.org
Wed Apr 10 02:43:44 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
- Merge branch 'master' into 8329431-improve-cds-write-heap-speed
- @matias9927 and @calvinccheung comments
- 8329431: Improve speed of writing CDS heap objects
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18572/files
- new: https://git.openjdk.org/jdk/pull/18572/files/d7b6eb6b..fe2d9e4a
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18572&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18572&range=01-02
Stats: 29218 lines in 685 files changed: 12673 ins; 11750 del; 4795 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