Hi!
I tried to find out how to get the best performance out of java using the new nanoTimer from Java 5.
I wrote a basic full-screen rendering loop (afaik a very fast one) but I’ve got a problem concerning image-acceleration.
You can download the app at:
http://www.donmatheo.de/java/performanceDemo/performanceDemo.zip
(jar-files include sources)
There are two jar-files in the zip:
-
performanceDemo_transacc.jar:
This is the loop using the command : System.setProperty(“sun.java2d.translaccel”, “true”); -
performanceDemo_nontransacc.jar
This is the same loop but without using System.setProperty(“sun.java2d.translaccel”, “true”);
The application loads a test.png image (with transparency). You can move the image with the cursor-keys (left,right,up,down).
My test-platform is:
P4 Mobile, 2,2 GHz
Mobile Radeon 9000
1GB RAM
OS: WinXP SP2
JRE: 1.5.0_03
When I run it with “System.setProperty(“sun.java2d.translaccel”, “true”);” I get about ten times faster performance than witout it. (~1000fps). But the movement is very jerky when I press “right” or “down”. “up” and “left” is very smooth.
When I disable “System.setProperty(“sun.java2d.translaccel”, “true”);”, the framerate drops to ~110fps but the movement is more fluently.
Anyway there’s sometimes a white flicker of the whole screen. I don’t know how to get rid of this.
Any help would be appreciated