RFR: 8292059: Do not inline InstanceKlass::allocate_instance()

Claes Redestad redestad at openjdk.org
Wed Mar 1 19:15:10 UTC 2023


On Tue, 28 Feb 2023 11:11:54 GMT, Afshin Zafari <duke at openjdk.org> wrote:

> The inline and not-inline versions of the method is stress tested to compare the performance difference. The statistics are drawn in the following charts. The vertical axis is in milliseconds.
> 
> ![chart (2)](https://user-images.githubusercontent.com/4697012/221848555-2884313e-9d26-41c9-a265-3f1ce295b17b.png)
> 
> ![chart (3)](https://user-images.githubusercontent.com/4697012/221863810-94118677-b4af-468f-90c6-5ea365ae3588.png)

I'm also skeptical as to the relevance of these numbers. `allocate_instance(oop, TRAPS)` is nowhere near GC code, so my guess is that there's run-to-run variation on whatever the workload is here.

I'm not against removing this inlining. I did it as a minor part of another startup optimization after checking that the inlining was size-neutral and noticing that this meant a speed-up in interpreter and C1 for some relatively common JNI calls. It might still be marginally beneficial there, but if there's a measurable impact on compilation time and header complexity then who am I to object.

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

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


More information about the hotspot-dev mailing list