RFR: 8231895: Avoid String allocations in JVM_FindLoadedClass

Jiangli Zhou jianglizhou at google.com
Sun Oct 6 02:32:00 UTC 2019


Looks good.

Best regards,
Jiangli

On Sat, Oct 5, 2019 at 3:52 PM Claes Redestad <claes.redestad at oracle.com> wrote:
>
> Hi,
>
> JVM_FindLoadedClass allocates a java String from JVM code to transform
> class names from external to internal representation (java.lang.Class ->
> java/lang/Class). This is both inefficient and redundant since we'll
> directly transform it to a utf-8 char* and then ignore the newly created
> String.
>
> Instead we should mutate the C string. There's a small improvement in
> a targeted microbenchmark (order of 100ns/op, see bug for details),
> although effect on most applications is likely to be in the noise.
>
> Webrev: http://cr.openjdk.java.net/~redestad/8231895/open.00/
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8231895
>
> Testing: tier1-3
>
> Thanks!
>
> /Claes


More information about the hotspot-runtime-dev mailing list