JDK-8098888 : Startup time improvement for prism jogl
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2010-08-14
  • Updated: 2015-06-16
  • Resolved: 2011-11-15
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.
Other
fx2.1Resolved
Related Reports
Blocks :  
Description
There is still room for improvement in the start-up time of prism-jogl library. This is a continuation work of RT-8703, but this enhancement is more involve than the scope the RT-8703 plus our focus is now Windows (which uses d3d). This should be look at when Mac or other Linux based OS systems become important.

We should look for a cheaper way to implement a cached list of available GL functions for a given context. The current implementation in GLContextImpl.setGLFunctionAvailability() is very expensive and even worst the existing start-up logic makes call to this function more than once. For the remaining ~200msec spend in prism pipe creation, about 90msec is spent in this function. Here is the timing out of a simple instrumented code:

dhcp-rmdc-twvpn-1-vpnpool-10-159-25-210:ShapeT3DTest cyang$ javafx -jar dist/ShapeT3DTest.jar
@@@@ GLContextImpl.setGLFunctionAvailability() ....
(%1) GLContextImpl.setGLFunctionAvailability() process takes *** est. time = 0.055 msec ***
(%2) GLContextImpl.setGLFunctionAvailability(): updateGLProcAddressTable() process takes *** est. time = 54.563 msec ***
@@@@ GLContextImpl.setGLFunctionAvailability() ....
@@@@ GLContextImpl.setGLFunctionAvailability() ....
running on this tread
NF.createWindow: screen: com.sun.javafx.newt.macosx.MacScreen
Window.create: com.sun.javafx.newt.macosx.MacScreen
@@@@ GLContextImpl.setGLFunctionAvailability() ....
(%1) GLContextImpl.setGLFunctionAvailability() process takes *** est. time = 0.0010 msec ***
(%2) GLContextImpl.setGLFunctionAvailability(): updateGLProcAddressTable() process takes *** est. time = 33.246 msec ***
@@@@ GLContextImpl.setGLFunctionAvailability() ....

Code diff:
chien-yangs-macbook-pro-2:runtime cyang$ hg status -radm
M prism-jogl/src/jogl/classes/com/sun/prism/opengl/impl/GLContextImpl.java
chien-yangs-macbook-pro-2:runtime cyang$ hg diff
diff -r 0f09d6c13340 prism-jogl/src/jogl/classes/com/sun/prism/opengl/impl/GLContextImpl.java
--- a/prism-jogl/src/jogl/classes/com/sun/prism/opengl/impl/GLContextImpl.java	Fri Aug 13 13:22:49 2010 -0700
+++ b/prism-jogl/src/jogl/classes/com/sun/prism/opengl/impl/GLContextImpl.java	Sat Aug 14 14:06:59 2010 -0700
@@ -375,6 +375,9 @@
    *              This might be usefull if you change the OpenGL implementation.
    */
   protected void setGLFunctionAvailability(boolean force) {
+   System.err.println("@@@@ GLContextImpl.setGLFunctionAvailability() ....");
+   long startTime = GLProfile.startTimer(null);
+
     if(null!=this.gl && null!=glProcAddressTable && !force) {
         return; // already done and not forced
     }
@@ -382,7 +385,11 @@
         setGL(createGL(getGLDrawable().getGLProfile()));
     }
 
-    updateGLProcAddressTable();
+   GLProfile.endTimer(startTime, "(%1) GLContextImpl.setGLFunctionAvailability() process takes");
+   startTime = GLProfile.startTimer(null);
+   updateGLProcAddressTable();
+   GLProfile.endTimer(startTime, "(%2) GLContextImpl.setGLFunctionAvailability(): updateGLProcAddressTable() process takes");
+
   }
 
   /**


Comments
This is a non-issue when we implemented the simple GL binding (RT-17485) as most of the JOGL complicated logic will be gone.
15-11-2011

Fixing RT-17485 will make this is obsolete.
18-10-2011

Now that Mac platform is becoming more important again, this should be re-evaluated for Presidio.
16-11-2010

A post-presidio task.
19-08-2010