java2d performace

Hi

My name is Cristian Chiovari and I am a software developer.
Java2d is a new field for me so I am wondering if you could help me
a little with some guidance.

I will be brief:
I have a pool of ~ 2000 objects which i want to draw on the screen.
Some of the object are changing location some not dependin on what
i get from an external source.
For this each object there is a renderable object which draw the object.
The actual drawing is made in a thread that on every (n) miliseconds
iterates the pool of objects and draw the objectson a panel.

This is very slow.It take sometimes more then a second to to this.

Is there a possibility to make this faster?
Using BufferImage VolatileImage…

Plz give me a hint…

Regards Cristian.

1.) Where do you draw to? (Screen, VolatileImage, BufferedImage, Managed Image)
2.) What “special features” are you using like AA or alpha colors?
3.) run your app with -Dsun.java2d.trace=count and post the result.

If your driver/gpu supports Java’s OpenGL pipeline, download mustang (mustang.dev.java.net) and try to run your program using the OpenGL pipeline (-Dsun.java2d.opengl=True). This especially helps when using AA or alpha.

Best whishes, lg Clemens

Thank you very much.
That was it.
(-Dsun.java2d.opengl=True)

thx again

be aware that this flag does not work properly on many graphic cards!
I would recommend to at least provide options to disable AA dn non-opaque rendering.

lg Clemens