RFR: 8343056: C2: Micro-optimize Node lists grow
Vladimir Kozlov
kvn at openjdk.org
Fri Oct 25 18:44:06 UTC 2024
On Fri, 25 Oct 2024 09:44:23 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Seen this in Leyden profiles, but it is a generic issue. The profiles show `Node::grow` and `VectorSet::grow` as hot methods. The methods are small, and since they are implementing doubling-the-array scheme, we often exit early without actually growing. Outlining the actual growing part from the capacity check would allow inlining the common case.
>
> I'll put some performance data in the comments.
>
> Additional testing:
> - [x] Linux x86_64 server fastdebug, `tier1`
Not related to your changes. But I am confused about `grow()` code which set new `_size` value. It is set to the same value as `_data_size` but it is described as "Used 32-bit words" vs "Allocated words" for `_data_size`.
I think it should be set to `new_word_capacity`.
-------------
PR Review: https://git.openjdk.org/jdk/pull/21707#pullrequestreview-2396163533
More information about the hotspot-dev
mailing list