Ok, I’ve run some benchmarks, lets see if they make sense.
Very simple test - fill a 1024 x 768 panel with line segments 3 pixels tall (so, 262,144 segments total).
All tests were on win2k with the latest java 1.6; I ran everything a few times and picked representative numbers.
I first ran this on my (fairly uncommon) Matrox Parhelia 650:
Default (trace: DXDrawLine)
time: 2344, segs/s: 111836
-Dsun.java2d.d3d=true (trace: D3DDrawLine)
time: 4625, segs/s: 56679
-Dsun.java2d.noddraw=true (trace: sun.java2d.loops.DrawLine::DrawLine(OpaqueColor, SrcNoEa, AnyInt))
time: 375, segs/s: 699050
-Dsun.java2d.opengl=true just ran in software.
So turning on D3D halves the speed from the original DX, and software is 12 times faster than D3D? Of course this card isn’t supposed to do much 3D acceleration.
I am also not very familiar with the windows 3D APIs: what exactly is the difference between D3D and DX? I thought they were part of the same thing?
While playing around with the start-up options from my IDE, I also managed to run it in a mode that traced as “sun.awt.windows.Win32BlitLoops::Blit(“Integer RGB DirectDraw”, SrcNoEa, “Integer RGB DirectDraw”)” - so DD, DX, and D3D are all different? (this ran a tiny bit slower than the DX).
I then figured I should run this on something that’s a) more common, b) has decent 3D performance, and c) is far from the top of the line : GeForce2MX 200.
Default (trace: DXDrawLine)
time: 4438, segs/s: 59068
-Dsun.java2d.d3d=true (trace: D3DDrawLine)
time: 734, segs/s: 357144
-Dsun.java2d.noddraw=true (trace: sun.java2d.loops.DrawLine::DrawLine(OpaqueColor, SrcNoEa, AnyInt))
time: 250, segs/s: 1048576
-Dsun.java2d.opengl=true (trace: OGLDrawLine )
time: 141, segs/s: 1859177
So here at least D3D is 6 times faster than DX, but software is still 3 times faster, and OpenGL blows everything else away.
Is this a fair test for what I’m trying to do?