RFR(S): 8067471: Use private static final char[0] for empty Strings

Lev Priima lev.priima at oracle.com
Sun Dec 21 15:37:35 UTC 2014


Thanks for exhaustive research. Looks formal enough to claim that both 
variants of change bring only perf advantages, but, as I understand, 
which one is better is not so straightforward.

On 12/19/2014 04:11 PM, Aleksey Shipilev wrote:
> On 12/19/2014 03:41 AM, Lev Priima wrote:
>> By naive glance, new constructor thrpt is  bigger(jdk9/dev vs 9b42
>> in attach) on:
>>      @Benchmark
>>      public String getNewString() {
>>          return new String();
>>      }
> This is how you do it:
>   http://cr.openjdk.java.net/~shade/8067471/
>   http://cr.openjdk.java.net/~shade/8067471/performance.txt
> In short, I don't see any show-stoppers here.
>> Please suggest things to compare . Do we have bigapps-like benchmarks
>> which may show regression on this?
> Not sure if there is such a benchmark in our pool. You may run
> SPECjbb2005 and SPECjvm2008 to double-check.
> Thanks,
> -Aleksey.

Best Regards,

More information about the core-libs-dev mailing list