RFR: 8142334: Improve lazy initialization of java.lang.invoke
claes.redestad at oracle.com
Mon Nov 9 17:51:25 UTC 2015
across java.lang.invoke there are a number of inner Lazy classes whose purpose is to defer initialization of various internally used NamedFunctions and MethodHandles until first usage. The issue is that once *any* function or handle in these classes are referenced they're all initialized, which somewhat defeats the purpose.
By moving to per-MethodHandle and per-NamedFunction lazy initialization, similar to existing code in java.lang.invoke.Invokers, we improve the laziness generally: for a jigsaw Hello World the number of LambdaForms created drops from 74 to 46, reducing heap occupancy for a minimal application and measurably improving startup time.
More information about the core-libs-dev