On Mon, 17 Jun 2024 11:21:37 GMT, Adam Sotona <asot...@openjdk.org> wrote:

>> LMF will BMH and `ClassSpecializer`, but does not call into this code 
>> normally as the simple bound method handle needed by LMF is statically 
>> defined (`BoundMethodHandle.Species_L`). To be perfectly safe - and to keep 
>> lambda/indy/condy bootstrap overheads to a minumum - I'll continue 
>> recommending the desugaring of lambdas in java.lang.invoke
>
> It results in not very nice code, but makes sense.

I'll note that replacing a lambda with an anonymous class has a very marginal 
effect on startup when amortizing the cost of setting up the infrastructure for 
spinning classes. What can have a decent effect is if we can replace a few 
lambdas/anon classes with more imperative code that spins up/loads fewer 
classes, e.g., desugaring streams to for loops.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17108#discussion_r1644202229

Reply via email to