How to speedup acquiring a GLProfile?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to speedup acquiring a GLProfile?

riven
For a Raspberry PI 2 project I'm using JOGL with NEWT. I'm seeing a rather large delay when I'm acquiring an OpenGL/ES profile.

The following code takes roughly 10s (!) on the Raspberry PI 2
Even on my rather beefy desktop it takes over 5s to acquire a GLProfile instance.
------------------
                long t0 = System.currentTimeMillis();
                //GLProfile profile = GLProfile.get(GLProfile.GL3); // desktop
                GLProfile profile = GLProfile.get(GLProfile.GL2ES2); // raspberry pi 2
                long t1 = System.currentTimeMillis();
                System.out.println("GLProfile took: " + (t1 - t0) + "ms");
------------------

Is there any way to speed up this process?

With kind regards,
 - Riven
Reply | Threaded
Open this post in threaded view
|

Re: How to speedup acquiring a GLProfile?

Xerxes Rånby
This post was updated on .
riven wrote
For a Raspberry PI 2 project I'm using JOGL with NEWT. I'm seeing a rather large delay when I'm acquiring an OpenGL/ES profile.

The following code takes roughly 10s (!) on the Raspberry PI 2
Even on my rather beefy desktop it takes over 5s to acquire a GLProfile instance.
------------------
                long t0 = System.currentTimeMillis();
                //GLProfile profile = GLProfile.get(GLProfile.GL3); // desktop
                GLProfile profile = GLProfile.get(GLProfile.GL2ES2); // raspberry pi 2
                long t1 = System.currentTimeMillis();
                System.out.println("GLProfile took: " + (t1 - t0) + "ms");
------------------

Is there any way to speed up this process?

With kind regards,
 - Riven
TL;DR: The fastest I can aquire a GLProfile is 1.6s on the RaspberryPi 2 is using OpenJDK 7 + jamvm 2.0.0 running unpacked class files.
On my "beefy" desktop the fastest I can aquire a GLProfile is 0.2s using OpenJDK 7 + jamvm 2.0.0 running unpacked class files.

Please describe how you deploy JOGL and which JOGL and JVM version you use, when I test using JOGL 2.3.1 stored in jars i get 4.4s startup using jogl-all.jar and 3.3s using jogl-all-mobile.jar on the Raspberry Pi 2 like this:
pi@raspberrypi ~/jogamp/jogamp-all-platforms $ cat TestGLProfile.java 
import com.jogamp.opengl.GLProfile;
public class TestGLProfile {
  public static void main(String[] args) {
    long t0 = System.currentTimeMillis();
    //GLProfile profile = GLProfile.get(GLProfile.GL3); // desktop
    GLProfile profile = GLProfile.get(GLProfile.GL2ES2); // raspberry pi 2
    long t1 = System.currentTimeMillis();
    System.out.println("GLProfile took: " + (t1 - t0) + "ms"); 
  }
}
pi@raspberrypi ~/jogamp/jogamp-all-platforms $ javac -cp jar/gluegen-rt.jar:jar/jogl-all.jar:. TestGLProfile.java
pi@raspberrypi ~/jogamp/jogamp-all-platforms $ java -cp jar/gluegen-rt.jar:jar/jogl-all.jar:. TestGLProfile
glGetError 0x500
glGetError 0x500
GLProfile took: 4406ms
pi@raspberrypi ~/jogamp/jogamp-all-platforms $ java -cp jar/gluegen-rt.jar:jar/jogl-all-mobile.jar:. TestGLProfile
glGetError 0x500
glGetError 0x500
GLProfile took: 3390ms

If I unzip gluegen-rt.jar jogl-all-mobile.jar gluegen-rt-natives-linux-armv6hf.jar jogl-all-mobile-natives-linux-armv6hf.jar then acquiring the profile only takes 2.8s on the RaspberryPi 2.

pi@raspberrypi ~/jogamp/jogamp-all-platforms/unpacked $ java TestGLProfile
glGetError 0x500
glGetError 0x500
GLProfile took: 2848ms

The above was using the raspbian packaged oracle jvm:
java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)

If I try to run the unpacked example using OpenJDK then i get the following times
pi@raspberrypi ~/jogamp/jogamp-all-platforms/unpacked $ /usr/lib/jvm/java-7-openjdk-armhf/bin/java TestGLProfile
glGetError 0x500
glGetError 0x500
GLProfile took: 5251ms
pi@raspberrypi ~/jogamp/jogamp-all-platforms/unpacked $ /usr/lib/jvm/java-7-openjdk-armhf/bin/java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~deb7u1+rpi1)
OpenJDK Zero VM (build 24.75-b04, mixed mode)


pi@raspberrypi ~/jogamp/jogamp-all-platforms/unpacked $ /usr/lib/jvm/java-7-openjdk-armhf/bin/java -jamvm TestGLProfile
glGetError 0x500
glGetError 0x500
GLProfile took: 1671ms

pi@raspberrypi ~/jogamp/jogamp-all-platforms/unpacked $ /usr/lib/jvm/java-7-openjdk-armhf/bin/java -jamvm -version
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~deb7u1+rpi1)
JamVM (build 2.0.0, inline-threaded interpreter with stack-caching)

Thus the fastest I can aquire a GLProfile is 1.6s on the RaspberryPi 2 is using OpenJDK 7 + jamvm 2.0.0 running unpacked class files.

---- running the same test on my "beefy" desktop: Ubuntu 14.04 LTS + Nvidia GTX 580 GPU +  FX 8320E CPU

familjen@monoliten:~/test/jogamp-all-platforms$ java -cp jar/gluegen-rt.jar:jar/jogl-all.jar:. TestGLProfile
libEGL warning: DRI2: failed to authenticate
GLProfile took: 1290ms
familjen@monoliten:~/test/jogamp-all-platforms$ java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

familjen@monoliten:~/test/jogamp-all-platforms$ java -jamvm -cp jar/gluegen-rt.jar:jar/jogl-all.jar:. TestGLProfile
libEGL warning: DRI2: failed to authenticate
GLProfile took: 787ms
familjen@monoliten:~/test/jogamp-all-platforms$ java -jamvm -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.04.2)
JamVM (build 2.0.0, inline-threaded interpreter)


unziped gluegen-rt.jar jogl-all-mobile.jar jogl-all-mobile-natives-linux-amd64.jar gluegen-rt-natives-linux-amd64.jar

familjen@monoliten:~/test/jogamp-all-platforms/unpack$ java TestGLProfile
libEGL warning: DRI2: failed to authenticate
GLProfile took: 517ms
familjen@monoliten:~/test/jogamp-all-platforms/unpack$ java -jamvm TestGLProfile
libEGL warning: DRI2: failed to authenticate
GLProfile took: 213ms

Thus the fastest I can aquire a GLProfile is 0.2s on my "beefy" system is using OpenJDK 7 + jamvm 2.0.0 running unpacked class files.