This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bad performance with JOGL and direct buffers


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]