RFR: 8168640: (fc) Avoiding AtomicBoolean in FileInput/-OutputStream improves startup

Claes Redestad claes.redestad at oracle.com
Wed Oct 26 15:59:47 UTC 2016


On 2016-10-26 17:10, Alan Bateman wrote:
> On 26/10/2016 13:11, Claes Redestad wrote:
>
>> Hi,
>>
>> does this commentary suffice?
>>
>> http://cr.openjdk.java.net/~redestad/8168640/webrev.02/
>>
>> To answer Paul's question about the exact startup gain:
>>
>> 20 named classes observable with -Xlog:class+load (11
>> additional anonymous show up in heap dumps), for example:
>>
>>   java.lang.invoke.MethodType$ConcurrentWeakInternSet
>>   java.lang.invoke.MethodType$ConcurrentWeakInternSet$WeakEntry
>>   java.lang.invoke.MethodTypeForm
>>   java.lang.invoke.VarHandle$1
>>   java.lang.invoke.VarHandle$AccessDescriptor
>>   java.lang.invoke.VarHandle$AccessMode
>>   java.lang.invoke.VarHandle$AccessType
>>   java.lang.invoke.VarHandleGuards
>>   java.lang.invoke.VarHandleInts$FieldInstanceReadOnly
>>   java.lang.invoke.VarHandleInts$FieldInstanceReadWrite
>>   java.lang.invoke.VarHandles
>>   java.lang.invoke.VarHandle$TypesAndInvokers
>>
>> Not initializing this eagerly drops retained heap on a minimal
>> Hello World by ~17Kb, and a 3-10ms startup improvement
>> on similar programs (naturally varies a lot between systems
>> due to timing of when/if JIT compilations happen during early
>> execution).
> I assume these classes will be loaded by anything non-trivial but 
> having them but keeping them out of hello world/short running tools is 
> good.

Right, making things lazier helps small programs, additionally there's 
potential long-term value in reducing the dependency graph to system 
initialization.

>
> The updated webrev looks okay to me.

Thanks for reviewing!

/Claes

>
> -Alan
>
>
>
>



More information about the core-libs-dev mailing list