RFR: 8329431: Improve speed of writing CDS heap objects [v2]
Matias Saavedra Silva
matsaave at openjdk.org
Wed Apr 10 00:25:09 UTC 2024
On Mon, 8 Apr 2024 02:52:31 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> [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:
>
> @matias9927 and @calvinccheung comments
Thanks for the updates!
-------------
Marked as reviewed by matsaave (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18572#pullrequestreview-1990493153
More information about the hotspot-runtime-dev
mailing list