How to improve SWT drawing performance?

I was tasked with improving the performance of stock market mapping software that uses SWT GCto draw diagrams. The graphic drawing needs to be improved, since the graphics are sometimes redrawn many times per second, and it consumes a lot of processor time.

After a short search, I found an entry that suggested direct modification of objects ImageDatainstead of using methods, a GCpromising big performance boost.

It is a simple task to draw horizontal and vertical straight and square shapes using this technique, but when it comes to drawing circles and other irregular shapes, there is no easy way.

Does anyone know if there is a library for drawing shapes on objects ImageData, how GCdo methods do on Imageobjects?

Also, does anyone know another way to improve SWT performance?

Thanks in advance.

+3
source share
3 answers

Instead of improving the performance of drawing routines, I would focus on drawing logic. Maybe you can just redraw the difference between the old and the new chart? This, of course, largely depends on how the diagrams look and what data they represent.

. .

+4

. ? . 90% . , .

SWT . , SWT - .

SWT . , . , , .

, , , . . GC ? ?

. , " ...", .

+5

( ), SWT OpenGL. , , .

. JOGL. , , SWT,

, API, , java.

On the other hand, as your scenes become more complex, the benefits of externalizing GPU rendering become more and more. I experienced an FPS win between 2x and 10x.

Another good thing: you don’t need to dive deep into OpenGL, there are large libraries like jMonkeyEngine , hiding the main complexity.

+2
source

All Articles