From 38b4f89d9d1d3e101620b54e558e90b16e87d9b1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 13 Dec 2011 04:45:39 +0100 Subject: 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. --- .../junit/jogl/acore/TestShutdownCompleteNEWT.java | 37 +++++++++++++++++++++- .../junit/jogl/acore/TestShutdownSharedNEWT.java | 18 +++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) (limited to 'src/test/com/jogamp') 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