DeXtmL
|
Posted: July 30, 2009 08:42 by DeXtmL
|
|
Two FloatBuffer(s): f1 = BufferUtil.newFloatBuffer(xxxx); f2 = FloatBuffer.allocate(xxxx); On my test of them, for every 10k vbo updates (BufferSubData), the direct buffer out performs the non-direct counterpart by 2~3ms. I think this is reasonless, because for direct buffer's FloatBuffer view, every get and put goes thru a non-cheap native call (JNI overhead) to convert between the java float primitive with the native bits. But non-direct FloatBuffer doesn't has such overhead. Can anyone explain this? dex |
Performance issue: Direct Buffer vs non-direct buffer
Replies: 2 - Last Post: July 30, 2009 13:14
by: DeXtmL
by: DeXtmL
showing 1 - 3 of 3
svengothel
|
Posted: July 30, 2009 10:42 by svengothel
|
|
Well, our BufferUtil direct buffer uses the native format, not the Java default big-endian format. So all data read/write from the Java side will be converted .. as you explained. I would recommend to use these direct native buffers only on low Java computations and for native caching. JOGL can use the direct native buffers without conversion, hence the performance benefit. |
Replies: 2 - Last Post: July 30, 2009 13:14
by: DeXtmL
by: DeXtmL







