diff options
author | Sven Gothel <[email protected]> | 2012-02-23 16:41:47 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-02-23 16:41:47 +0100 |
commit | 5b05aa83f57b7492b2705529033a7eaa09cf4463 (patch) | |
tree | 788e7a5d16ebce1a984f20f2b94faf96d5c62126 /src/newt/classes/com | |
parent | 352013de5564013fe2b6444e6469ef2886f1adb9 (diff) |
NEWT: Add time costs in DEBUG mode. NEWT/XRandR: Reuse XRRScreenConfiguration to reduce perf hit on Linux ARM Omap4.
On Linux ARM Omap4, we experience a performance hit when using XRandR:
1st call of XRRSizes: ~ 1668 ms
Each call of XRRGetScreenInfo: ~ 1109 ms
Even though XRRGetScreenInfo is cached in NEWT's X11Screen initialization,
overall init time is ~2s, far too expensive.
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index dc2db7f74..c0d79a5d4 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -394,11 +394,12 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC } public synchronized void setVisibleActionPost(boolean visible, boolean nativeWindowCreated) { + long t0; if(Window.DEBUG_IMPLEMENTATION) { - String msg = "GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+Thread.currentThread()+", start"; - System.err.println(msg); - // Exception e1 = new Exception(msg); - // e1.printStackTrace(); + t0 = System.nanoTime(); + System.err.println("GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+Thread.currentThread()+", start"); + } else { + t0 = 0; } /* if (nativeWindowCreated && null != context) { @@ -423,10 +424,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC context.setContextCreationFlags(additionalCtxCreationFlags); } if(Window.DEBUG_IMPLEMENTATION) { - String msg = "GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+Thread.currentThread()+", fin"; - System.err.println(msg); - //Exception e1 = new Exception(msg); - //e1.printStackTrace(); + System.err.println("GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+Thread.currentThread()+", fin: dt "+ (System.nanoTime()-t0)/1e6 +"ms"); } } |