Ok, I don’t know if it’s been said before, but I just want to share the results of a little experimentation.
I wanted to do some simple sprite stuff, and I wasn’t happy at all with the results I got. ~35 fps on a P4 2.4 GHz, Nvidia GF FX etc etc wasn’t what I was expecting.
The bottleneck, it appeared, was the Graphics.drawImage(). For some reason it was SO SLOW, so I digged further and further. It appeared my graphics weren’t accelerated by my gfx card. everything was done is software. No wonder it was so slow.
So I started poking around and I found some java runtime options which greatly helped my performance.
System.setProperty(“sun.java2d.translaccel”,“true”);
System.setProperty(“sun.java2d.accthreshold”, “0”);
System.setProperty(“sun.java2d.ddscale”,“true”);
System.setProperty(“sun.java2d.ddforcevram”, “true”);
now I get ~150 fps constantly.
I played with “sun.java2d.opengl”,“true” too, but that appears to be buggy. Dunno, just didn’t work for me.
I hope this is helpful to someone.
regards,
- Vincent 8)