initialization times for invokedynamic
Jochen Theodorou
blackdrag at gmx.org
Tue Sep 5 06:58:23 UTC 2023
On 04.09.23 14:14, Claes Redestad wrote:
> Hi,
>
> Could you post the full benchmark code somewhere?
>
> Which JDK version did you test this on? Later JDKs will use a MH-backed solution under the covers but much of the overhead of early initialization is mitigated by various techniques (pre-generating some LambdaForms, caching some runtime generated code in CDS etc) so it’s important for context to get more details.
I changed the code a little bit in the meantime. I now no longer measure
the first indy callsite, but also a second callsite to the same method
using the same bootstrap method and I see an improvement as times go
down from 863k to 136k. There seems to be a lot of code initialization.
That is then 142k for the first 12 calls. (vs 88k in case of reflection,
which means still a lot of calls before indy gets in front).
I used JDK 17.0.7. As for the test (I would actually not really call
that a benchmark). I basically used this here
https://gist.github.com/blackdrag/28df334a8f49f06048d19848a50828c8
bye Jochen
More information about the mlvm-dev
mailing list