From 5b05aa83f57b7492b2705529033a7eaa09cf4463 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 23 Feb 2012 16:41:47 +0100 Subject: 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. --- src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/newt/classes/com/jogamp') 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"); } } -- cgit v1.2.3