RFR: 8198888: Reduce string allocation churn in InvokerBytecodeGenerator

Andrej Golovnin andrej.golovnin at gmail.com
Thu Mar 1 12:31:33 UTC 2018


Hi Claes,

src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java

  96     /** Internal name lookup cache. */
  97     private HashMap<Class<?>, String> nameMap;

617             nameMap = new HashMap<>(2);

Have you tested it with IdentityHashMap? Maybe it would be even better
as Class<?> does not have own implementations of #hasCode() and
#equals() methods.

Best regards,
Andrej Golovnin

On Thu, Mar 1, 2018 at 1:14 PM, Claes Redestad
<claes.redestad at oracle.com> 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