|Re: SWT painting performance [message #508597 is a reply to message #508097]
||Tue, 19 January 2010 15:14
| Grant Gayed
Registered: July 2009
We were not aware of this performance issue. Looking at swt's win32
implementation of GC.drawPolyline(), it's basically just three gdip calls
when advanced graphics is turned on, so the time is being spent in gdip. I
don't think there's anything swt can do about this. If possible, you can
see if turning off advanced graphics makes this perform faster.
As a side note, there's a new Direct X library available as of Windows 7
which should have better performance than gdip. swt's advanced graphics
support on win32 could be enhanced in a future release to use this library
instead if it's available.
"Alex Boyko" <firstname.lastname@example.org> wrote in message
> We have a performance issue in Draw2D (Eclipse\GEF) with painting lines
with dash pattern.
> Draw2D is well optimized to paint only regions of the canvas that should
> The problem:
> A GEF diagram has a lot of lines painted (links between nodes). Lines are
drawn with GC#drawPolyline(...) method. Antialias and advanced graphics are
set to "ON" on the GC. Scrolling a diagram with solid lines works well.
Scrolling a diagram with non-solid lines (LINE_DOT) works very slow.
> Profiling has shown that most of the time is spent in gdip draw lines
> Measuring the time of each GC#drawPolyline(...) call has shown that many
times for a solid line this method takes 0 time to execute, while for
non-solid line it returned some non-zero time (15ms) much more often.
> I'm guessing that there is some caching happening in the native code, so
paint calls sometime don't take any execution time, and take time only when
something does need a repaint.
> I wonder now why the non-solid line is repainted more than 10 times more
often than the solid line? Is this reasonable? Can this be improved in SWT?
> Thanks in advance.
Powered by FUDForum
. Page generated in 0.02086 seconds