Re: RFR: 8198888: Reduce string allocation churn in InvokerBytecodeGenerator

2018-03-01 Thread Paul Sandoz
It’s not just the internal VM name, it's also a descriptor in byte code. I hope the symbolic ref API currently being designed in the amber repo will help here. Until that settles i would be reluctant to consider adding public “toDescriptor” methods, or even do something internally right now if

Re: RFR: 8198888: Reduce string allocation churn in InvokerBytecodeGenerator

2018-03-01 Thread Paul Sandoz
> On Mar 1, 2018, at 4:14 AM, 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/819/jdk.00/ > Bug: https://bugs.openjdk.java.net/browse/JDK-819 >

Re: RFR: 8198888: Reduce string allocation churn in InvokerBytecodeGenerator

2018-03-01 Thread Claes Redestad
That few, huh? Well, if you ask me the VM internal name and the java class names should have been synced up long ago. :-) I'd not be averse to some real API point in a future RFE. I think this has been dodged in the past to avoid leaking the VM internal representation everywhere. /Claes On

Re: RFR: 8198888: Reduce string allocation churn in InvokerBytecodeGenerator

2018-03-01 Thread Peter Levart
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

Re: RFR: 8198888: Reduce string allocation churn in InvokerBytecodeGenerator

2018-03-01 Thread Claes Redestad
Hi, as equals/hashCode on Class mirrors are already using identity semantics, I don't think we actually gain much from using an IdentityHashMap, and I don't want to add new dependencies to this java.lang.invoke (we have some ambition to reduce the number of java.util classes used from

Re: RFR: 8198888: Reduce string allocation churn in InvokerBytecodeGenerator

2018-03-01 Thread Andrej Golovnin
Hi Claes, src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java 96 /** Internal name lookup cache. */ 97 private HashMap nameMap; 617 nameMap = new HashMap<>(2); Have you tested it with IdentityHashMap? Maybe it would be even better

RFR: 8198888: Reduce string allocation churn in InvokerBytecodeGenerator

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