RFR8220166 : Performance regression in deserialization

David Holmes david.holmes at oracle.com
Thu May 16 09:16:52 UTC 2019


Hi Roger,

On 16/05/2019 6:32 am, Roger Riggs wrote:
> Please review a change in the synchronization during the creation of an 
> ObjectInputStream.
> Currently, a synchronized block is used to initialize the streams filter 
> is read the global serial filter
> which becomes a bottleneck under high concurrency.  Since the value only 
> ever changes from null to non-null
> once, the synchronization is not needed.  Changing the field to volatile 
> and removing
> the synchronization on read should alleviate the contention.

That looks fine to me. Even if the value could change repeatedly you 
don't need the sync on the read, as long as its volatile.

Cheers,
David
-----

> Issue:
>    https://bugs.openjdk.java.net/browse/JDK-8220166
> 
> Webrev:
>    http://cr.openjdk.java.net/~rriggs/webrev-fix-8220166/index.html
> 
> Thanks, Roger
> 


More information about the core-libs-dev mailing list