RFR [15] 8248233: Avoid superfluous Class::isRecord invocations during deserialization

Claes Redestad claes.redestad at oracle.com
Wed Jun 24 16:15:35 UTC 2020


Hi Chris,

On 2020-06-24 17:46, Chris Hegarty wrote:
> A micro-optimisation noticed when working on JDK-8247532.
> 
> For further details see:
>    https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-June/067446.html
> 
> Webrev:
>    https://cr.openjdk.java.net/~chegar/8248233/webrev.00/

This looks good.

It seems ObjectInputStream#isRecord(Class) is now unused. No need for
a new webrev if you choose to remove it.

/Claes

> 
> before:
>   RecordSerializationBench.deserializeClasses        10  avgt   10   13.874 ±  1.445  us/op
>   RecordSerializationBench.deserializeClasses       100  avgt   10   57.839 ±  3.944  us/op
>   RecordSerializationBench.deserializeClasses      1000  avgt   10  515.483 ± 57.275  us/op
>   RecordSerializationBench.deserializeRecords        10  avgt   10   13.563 ±  0.459  us/op
>   RecordSerializationBench.deserializeRecords       100  avgt   10   61.704 ±  2.481  us/op
>   RecordSerializationBench.deserializeRecords      1000  avgt   10  518.671 ± 19.147  us/op
> after:
>   RecordSerializationBench.deserializeClasses        10  avgt   10   16.021 ±  9.091  us/op
>   RecordSerializationBench.deserializeClasses       100  avgt   10   58.550 ±  2.164  us/op
>   RecordSerializationBench.deserializeClasses      1000  avgt   10  524.930 ± 49.663  us/op
>   RecordSerializationBench.deserializeRecords        10  avgt   10   12.567 ±  0.711  us/op
>   RecordSerializationBench.deserializeRecords       100  avgt   10   50.235 ±  1.977  us/op
>   RecordSerializationBench.deserializeRecords      1000  avgt   10  421.557 ± 17.348  us/op
> 
> -Chris.
> 
> [1] https://bugs.openjdk.java.net/browse/JDK-8247532
> 


More information about the core-libs-dev mailing list