JDK-8189917 : Dynamic Constant performance assessment
  • Type: Sub-task
  • Component: performance
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2017-10-24
  • Updated: 2017-12-05
  • Resolved: 2017-12-05
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 11
11Resolved
Description
From Brian Goetz:

I think we need at least one performance study, which could be as simple as a JMH benchmark of
    getstatic Integer.TYPE
vs
    LDC ConDy[BSM=primitiveClass, name=I]
This will tell us if something woefully wrong is going on (such as getting relinked on every access.) 
Comments
The quick assessment benchmark and results look good.
05-12-2017

Attached simple condy-micros micros, which are based on the jdk.experimental.bytecode library from the amber/amber condy branch. Test setup generates a class which does LDC ConDy (condyLoad), generates a class that does the getstatic load (dummyLoad), sets up invoking the methods that does this using MethodHandles. A baseline static call is included (shows there's some setup overhead for invoking MethodHandles): java -jar benchmarks.jar -f 5 -tu ns -bm avgt -wi 5 -i 5 Benchmark Mode Cnt Score Error Units CondyLoad.condyLoad avgt 5 7.172 �� 0.030 ns/op CondyLoad.dummyLoad avgt 5 7.195 �� 0.193 ns/op CondyLoad.staticLoad avgt 5 3.142 �� 0.027 ns/op This quick assessment doesn't indicate any woeful wrongness in the current condy implementation.
16-11-2017