diff options
author | Sven Gothel <[email protected]> | 2011-12-13 04:45:39 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-12-13 04:45:39 +0100 |
commit | 38b4f89d9d1d3e101620b54e558e90b16e87d9b1 (patch) | |
tree | 4ec2aa5128e622565d33a489f06fb8b03b42d09c /src/test/com/jogamp/opengl | |
parent | ed92cc34e42e334373c31a54ba601d8a9781228e (diff) |
setGLFunctionAvailability(..): Reduce the calls to resetProcAddressTable() 12 -> 7 in initialization.
Reducing the calls to resetProcAddressTable() 12 -> 7 in initialization, saves:
Linux/AMD: 600ms -> 300ms
Linux/NV: 161ms -> 112ms
OSX 10.7/NV: 522ms -> 397ms
Still some freezes on OSX 10.6.8/NV .. further analysis is going on.
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java | 37 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownSharedNEWT.java | 18 |
2 files changed, 54 insertions, 1 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java index 40f13e834..1abac1094 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java @@ -28,7 +28,9 @@ package com.jogamp.opengl.test.junit.jogl.acore; +import java.io.BufferedReader; import java.io.IOException; +import java.io.InputStreamReader; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLProfile; @@ -72,10 +74,15 @@ public class TestShutdownCompleteNEWT extends UITestCase { } protected void oneLife() throws InterruptedException { + if(waitForEach) { + waitForEnter(); + } long t0 = System.nanoTime(); GLProfile.initSingleton(); long t1 = System.nanoTime(); - runTestGL(); + if(!initOnly) { + runTestGL(); + } long t2 = System.nanoTime(); GLProfile.shutdown(GLProfile.ShutdownType.COMPLETE); long t3 = System.nanoTime(); @@ -101,7 +108,35 @@ public class TestShutdownCompleteNEWT extends UITestCase { oneLife(); } + static boolean initOnly = false; + static boolean waitForEach = false; + + static void waitForEnter() { + BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); + System.err.println("Press enter to continue"); + try { + System.err.println(stdin.readLine()); + } catch (IOException e) { } + } + public static void main(String args[]) throws IOException { + boolean waitForKey = false; + + for(int i=0; i<args.length; i++) { + if(args[i].equals("-wait")) { + waitForKey = true; + } else if(args[i].equals("-waitForEach")) { + waitForEach = true; + waitForKey = true; + } else if(args[i].equals("-initOnly")) { + initOnly = true; + } + } + + if(waitForKey) { + waitForEnter(); + } + String tstname = TestShutdownCompleteNEWT.class.getName(); org.junit.runner.JUnitCore.main(tstname); } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownSharedNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownSharedNEWT.java index b0096e2b1..99b5a6c48 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownSharedNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownSharedNEWT.java @@ -28,7 +28,9 @@ package com.jogamp.opengl.test.junit.jogl.acore; +import java.io.BufferedReader; import java.io.IOException; +import java.io.InputStreamReader; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLProfile; @@ -102,6 +104,22 @@ public class TestShutdownSharedNEWT extends UITestCase { } public static void main(String args[]) throws IOException { + boolean waitForKey = false; + + for(int i=0; i<args.length; i++) { + if(args[i].equals("-wait")) { + waitForKey = true; + } + } + + if(waitForKey) { + BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); + System.err.println("Press enter to continue"); + try { + System.err.println(stdin.readLine()); + } catch (IOException e) { } + } + String tstname = TestShutdownSharedNEWT.class.getName(); org.junit.runner.JUnitCore.main(tstname); } |