JDK-8217442 : Optimize native accesses to String.value
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-01-21
  • Updated: 2019-03-12
  • Resolved: 2019-01-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13 b05Fixed
Related Reports
Relates :  
Relates :  
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.
Comments
Patch: http://cr.openjdk.java.net/~redestad/8217442/open.00/
21-01-2019