RFR: 8170467: (reflect) Optimize SignatureParser's use of StringBuilders

Claes Redestad claes.redestad at oracle.com
Tue Nov 29 14:03:26 UTC 2016


Hi Andrej,

On 2016-11-29 14:39, Andrej Golovnin wrote:
> Hi Claes,
>
> 76     public static final int CLASS_NAME_SB_SIZE = 48;
>
> Why is this constant public?

Good catch, made it private.

> Btw. for our product this value is too small. We have packages with
> longer names. I would use 64. :-)

There's no one size fits all: something around 48 is likely to
help most common cases, while not noticeably penalizing
shorter names. I'd consider it a bad move to regress apps
with short-to-normal names to get a small gain on apps with
very long names

Thanks!

/Claes

>
> Best regards,
> Andrej Golovnin
>
> On Tue, Nov 29, 2016 at 2:18 PM, Claes Redestad
> <claes.redestad at oracle.com> wrote:
>> Hi,
>>
>> please review this patch provided by Max Kanat-Alexander[1] to improve
>> performance of sun.reflect.generics.parser.SignatureParser by reducing
>> number of StringBuilders created and the rate at which they are resized
>> during typical usage.
>>
>> Webrev: http://cr.openjdk.java.net/~redestad/8170467/webrev.01/
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8170467
>>
>> Thanks!
>>
>> /Claes
>>
>> [1]
>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-November/045046.html



More information about the core-libs-dev mailing list