Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8217442

Optimize native accesses to String.value

    XMLWordPrintable

Details

    • b05

    Description

      Operations like jni_GetStringLength and jni_GetStringUTFLength expliclity check if value is null before calling java_lang_String::length / utf8_length, but that method will then do the same thing and return 0, making the outer check redundant.

      These repeat accesses turn out to be somewhat costly since the access API emit access barriers. This adds up measurably, especially during startup.

      Streamlining the internal String access API so that we avoid repeat access of String.value brings a measurable improvement, ~10-15% on native operations over small Strings.

      Attachments

        Issue Links

          Activity

            People

              redestad Claes Redestad
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: