Performance

Hi WhiteHexagon,

I was skeptical of the numbers you posted, so I created a little test to try the different methods. Here it is (requires Java 5.0+, LWJGL, GL1.3+, GL2.0 for the final test):

Bricks Test (439kb zip, includes source & win32 LWJGL binaries)

The test renders 18x18x18 “bricks” (6 QUADS, normals are specified but with no lighting or texturing). I assumed as a requirement that each brick is dynamic in position and appearance, so I’m rendering a total of 5832 unique bricks, while constantly animating their position and color.

There are 3 tests currently (press SPACE to change the active test):

  • Immediate mode rendering. Uses glTranslate and glBegin(GL_QUADS).
  • Simple display list rendering. Uses glTranslate and glCallList.
  • Display list rendering with pseudo-instancing. Uses a vertex shader to pass the brick position as a texture coordinate and glCallList.

I didn’t have time to add a vertex array test, feel free to add one.

So, here are my results:

WinXP, Athlon XP 2800+, GeForce 6800GT AGP, Java 6 b90

       Client VM     Server VM
       -------------      -------------
  1. IM 52 fps 65 fps
  2. DL 155 fps 170 fps
  3. PI 253 fps 253 fps

I don’t know if this is still relevant to the discussion, but I found that theres quite a difference between rendering line primatives (eg. glBegin(GL_LINE):wink: and line fill mode (eg. glPolygonMode(GL_LINE)). Line fill/poly mode tends to be rather slow, but doing the equivilent work manually and just rendering line primatives is much faster.

Seems rather odd to me, but it might be worth looking into.

WinXP, P4 3GHz, Ati x300 PCIe, Java 1.5.0_06
IM: 63
DL: 80
no difference between server and client (?)

Suse 10.1, radeon 9700 mobility, ATI drivers 8.26.18, Pentium M 1700 Mhz, java 1.5.0_07 (client and server the same):

IM: 54
DL: 110
DLadv: 180

Latest mustang gives me 66 for IM with -server, the rest are the same.

  • elias

Hi Spasi, A big thanks for writing that!

And interesting to see others results. Here’s what I got on my hardware. (GeForce 6200/AGP/SSE2, Java 1.5.0_06, Pentium M760, Win 2K). I only tried client VM, don’t think my machine is quite server spec :slight_smile:

IM: 74fps
DL: 69fps
PI: 73fps

The CPU was maxed out, but the display was very pretty :slight_smile:
I have some lighting and textures which might be slowing my stuff down. Plus as you can see the machine spec is quite low. But obviously I’m doing something wrong in my code to be twice as slow, unless it’s the way I’m configuring JOGL.

I shall try to extract my drawing code into a testable unit which should make it easier to test, currently is quite heavily dependant on a whole bunch of other code.

Cheers

Peter

Windows XP x64, Dual 7900 GTX 512 Sli, Dual Opteron 252 @ 2.6Ghz, 8Gb Ram, Nvidia 91.31 Driver, Mustang Beta 2 32-bit VM

Client 32-bit VM
IM: 106 FPS
DL: 260 FPS
PI: 328 FPS

Server 32-bit VM
IM: 108 FPS
DL: 264 FPS
PI: 331 FPS

WinXP, ATI mobility Radeon X700, no idea what processor it has but Windows says a 1.73GHz Intel, 1GB

java version “1.6.0-rc-fastdebug”
Java™ SE Runtime Environment (build 1.6.0-rc-fastdebug-b88)
Java HotSpot™ Client VM (build 1.6.0-rc-fastdebug-b88-debug, mixed mode)

IM: 83 fps
DL: 139 fps
PI: 171 fps

Server VM hardly makes a difference

Found this, I guess you asked for tricks for drawing borders:
http://www.opengl.org/resources/faq/technical/polygonoffset.htm

Thanks joda,

I currently used the polygon offset on another part of the engine, but never really understood what it was doing :slight_smile: It works okay for most cases but I found a few gcards where I get really nasty result when two polygons intersect, kinda heavy saw tooth effect, if that makes sense. Using the stencil buffer technique looks a bit tricky, but maybe something I will brave once I learn a bit more about OpenGL.

Anyway regarding the performance issue, I’ve managed to rip out most of my engine code into a stadalone test now, apart from Texture loading where I use some custom file formats. Does anyone have a simple bit of code to generate a texture ie. doesn’t need to load a texture?

Thanks

Peter

just give us some code that uses TextureIO.newTexture(new File(“test.jpg”), true), and create a dummy jpg file. It shouldn’t be that hard to grab a dummy jpg from the net, should it ? ;D

Cool, Haven’t tried to TextureIO class before! all that code I did for nothing :slight_smile:

Anyway, I put a copy of the code up on my site. I can setup a webstart to runit if that helps anyone?
http://www.whitehexagon.com/Brix.java

Apologies but the code is a mess. It’s a cut and paste job from many parts of the engine, so I hope it makes sense. It’s normally full screen, but that code isn’t the most reliable to I just maxed it to 1280 by 1024 for now.
There’s a really exciting texture there in case you dont find a nicer one to use :wink:

http://www.whitehexagon.com/studs256256.png

This is the code I tried that was only hitting around 30fps, and stil does… seems strange considering Spasi’s results. I guess I’m doing something silly here, but can’t spot what.

Thanks

Peter