RFR [15] 8248233: Avoid superfluous Class::isRecord invocations during deserialization
Peter Levart
peter.levart at gmail.com
Wed Jun 24 17:31:11 UTC 2020
On 6/24/20 6:53 PM, Chris Hegarty wrote:
>
>> On 24 Jun 2020, at 17:15, Claes Redestad <claes.redestad at oracle.com
>> <mailto:claes.redestad at oracle.com>> wrote:
>>
>> ...
>> It seems ObjectInputStream#isRecord(Class) is now unused. No need for
>> a new webrev if you choose to remove it.
>
> Good catch, now removed.
>
>> On 24 Jun 2020, at 17:25, Peter Levart <peter.levart at gmail.com
>> <mailto:peter.levart at gmail.com>> wrote:
>>
>> Hi Chris,
>>
>> The patch looks good.
>>
>> Before the patch it made sense to have if (cl != null) in line 750 in
>> ObjectStreamClass, but now nothing in the if block depends on cl, so
>> you could use if (osc != null) instead. It is true that:
>>
>> (cl != null) == (osc != null)
>>
>> always holds there, but reading the code is easier that way, don't
>> you think? Maybe you could even consider merging the content of this
>> if block into the similar if block that starts in line 771?
>>
> Yes, good idea. Done.
>
> Updated webrev:
> https://cr.openjdk.java.net/~chegar/8248233/webrev.01
>
> -Chris.
This looks good.
Now next thing to do perhaps is to find out why deserialization of
classical classes is slower than deserialization of records ;-)
Regards, Peter
More information about the core-libs-dev
mailing list