This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Bad performance with JOGL and direct buffers
- From: David Daney <ddaney at avtrex dot com>
- To: Stefan Krause <stefan at stefankrause dot net>
- Cc: java at gcc dot gnu dot org
- Date: Fri, 09 Nov 2007 14:36:53 -0800
- Subject: Re: Bad performance with JOGL and direct buffers
- References: <4734DDD0.2080300@stefankrause.net>
Stefan Krause wrote:
I recently tried to compile a small JOGL demo with GCJ. I had to use SWT
because GCJ would throw an exception with AWT and JOGL 1.1 (Exception
in thread "main" java.lang.IllegalArgumentException:
GLDrawableFactory.chooseGraphicsConfiguration() was not used when
creating this Component
at
com.sun.opengl.impl.x11.X11GLDrawableFactory.getGLDrawable(jogl.jar.so))
- but never mind, the SWT version is faster on Ubuntu Linux anyways.
The GCJ compiled demo runs okay with SWT and JOGL, but the performance
isn't quite as good as with Sun's JDK 6. The performance is something
like 128 FPS for GCJ and 200 FPS for JDK 6. When I remove only the
OpenGL calls from the render loop the performance for both JDK 6 and GCJ
is equal. It even seems as if all methods except gl.glDrawRangeElements
do not slow GCJ down. I'm using OpenGL Vertex Buffer Objects with direct
buffers. The buffers passed to glDrawRangeElements are (many) IntBuffers
each created like that:
ByteBuffer bb = ByteBuffer.allocateDirect(byteCount);
bb.order(ByteOrder.nativeOrder());
IntBuffer ib = bb.asIntBuffer();
Before starting further investigations: Does anyone have an idea what
might slow GCJ that much down? I don't think GCJ adds that much of JNI
overhead (since the empty render loop is equally fast). Are there any
known GCJ performance problems / pitfalls with direct buffers?
Perhaps related to this:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27982
David Daney