ScopedValue performance declines as number of dynamic bindings increases
Aleksey Shipilev
shipilev at amazon.de
Tue Jun 24 16:08:53 UTC 2025
On 24.06.25 18:01, Johan Sjolen wrote:
> Oooh, that could explain the issue completely. I didn't think about that at all.
> The issue basically disappears when compiling first, let me see what happens with a JMH benchmark as well.
I predict JMH would show the same thing.
javac is not very fast when cold; this is also why we use it as go-to example in AOT cache studies.
I would also expect compiling deeply nested lambdas (like in ScopedTest.java) makes the javac code
fairly recursive, which again plays interestingly with JIT compilation. It is still
actionable/interesting to figure out what can be improved there. Looks fairly weird we spend >3
seconds compiling a seemingly "easy" source. Submit a tools/javac RFE, let compiler folks have fun
with it?
-Aleksey
Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
More information about the loom-dev
mailing list