RFR: 8342724: Improve the performance and memory consumption of VMATree::register_mapping
Johan Sjölen
jsjolen at openjdk.org
Tue Oct 22 13:23:07 UTC 2024
Today, VMATree::register_mapping depends on two worklist arrays which are used for keeping track of the iteration order of the tree. These arrays are re-allocated for each call to register_mapping, which has a measurable performance impact on the tree.
This PR intends to remedy the situation in two ways:
1. By removing one of the arrays entirely, and instead using merge/split operations for what this array used to be employed for.
2. By saving the remaining array as part of the VMATree instance, reusing it. As the size of this tree grows on an order of log n where n is the number of nodes in the tree, and its elements are small, this is not a large cost.
When measuring performance, I have observed a ~2x improvement through the use of a profiler. My colleague, @gerard-ziemski, has observed a ~3x improvement when running Java2Demo with NMT summary mode in terms of CPU time over a set of NMT operations.
Cheers.
-------------
Commit messages:
- Make fast
Changes: https://git.openjdk.org/jdk/pull/21621/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21621&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8342724
Stats: 122 lines in 4 files changed: 61 ins; 32 del; 29 mod
Patch: https://git.openjdk.org/jdk/pull/21621.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21621/head:pull/21621
PR: https://git.openjdk.org/jdk/pull/21621
More information about the hotspot-runtime-dev
mailing list