RFR: 8198888: Reduce string allocation churn in InvokerBytecodeGenerator

Peter Levart peter.levart at gmail.com
Thu Mar 1 13:17:33 UTC 2018

Hi Claes,

  623             name = c.getName().replace('.', '/');

Did you know that there are 319 occurrences of .replace('.', '/') in JDK 
sources and tests (45 occurrences in java.base without tests)?

Isn't that enough to create a special API on the java.lang.Class that 
would cache this or at least something in an internal java.base package?

Regards, Peter

On 03/01/2018 01:14 PM, Claes Redestad wrote:
> Hi,
> two trivial optimizations that get rid of a few percent on ISC startup 
> tests.
> Webrev: http://cr.openjdk.java.net/~redestad/8198888/jdk.00/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8198888
> Thanks!
> /Claes

More information about the core-libs-dev mailing list