Would it be helpful to have benchmarks for the other types, just in case? 

Don't see any tests to ensure all cases are covered. May be relying on existing 
tests, but... minimally tag those tests.

Cheers,

-- Jim


> On Jun 16, 2020, at 10:00 AM, Claes Redestad <claes.redes...@oracle.com> 
> wrote:
> 
> Hi,
> 
> this patch specializes bootstrapping of unary concatenation expressions.
> 
> Such expressions can be reduced to the canonical String.valueOf
> "stringifier" for any primitive argument, but needs a special
> stringifier for reference arguments since we need to produce a new
> String to be compliant with JLS.
> 
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8247681
> Webrev: http://cr.openjdk.java.net/~redestad/8247681/open.00/
> 
> This ensures we get a similar speed-up as JDK-8247605 for
> "" + fooString (and fooString + "").
> 
> Also speeds up bootstrapping for all such simple unary concatenation
> expressions.
> 
> Testing: tier1+2
> 
> Before:
> 
> Benchmark                            (intValue)  Mode  Cnt   Score Error  
> Units
> StringConcat.concatEmptyConstInt           4711  avgt    5  15.539 ± 0.831  
> ns/op
> StringConcat.concatEmptyConstString        4711  avgt    5  17.046 ± 1.047  
> ns/op
> StringConcat.concatEmptyLeft               4711  avgt    5   7.506 ± 0.588  
> ns/op
> StringConcat.concatEmptyRight              4711  avgt    5   7.890 ± 0.314  
> ns/op
> 
> After:
> Benchmark                            (intValue)  Mode  Cnt   Score Error  
> Units
> StringConcat.concatEmptyConstInt           4711  avgt    5  15.410 ± 0.944  
> ns/op
> StringConcat.concatEmptyConstString        4711  avgt    5   7.397 ± 0.384  
> ns/op
> StringConcat.concatEmptyLeft               4711  avgt    5   7.465 ± 0.328  
> ns/op
> StringConcat.concatEmptyRight              4711  avgt    5   7.857 ± 0.355  
> ns/op
> 
> Thanks!
> 
> /Claes

Reply via email to