Re: Scintilla GTK2 profiling results



On Wed, 2003-04-16 at 16:12, Neil Hodgson wrote:
> Owen Taylor:
> 
> > Generally you want synchronous exposes of the target widget on
> > scrolling; it just looks better, and for another thing, if you don't
> > do your drawing, GTK+ may spend all the CPU time doing a beautifully
> > smooth animation of the scrollbar.
> 
>    For user initiated scrols, synchronous exposes are good. However,
> Scintilla also manipulates the current scroll position, when, for example
> changing documents or moving to a searched for string. For these operation,
> there may be other invalidates performed. Because the text and the scroll
> bar share a window, these invalidates are combined into a single expose that
> will often hit the whole window. Because the expose is synchronous, it will
> not then be combined with other invalidates in the same operation.
> 
> > If Scintilla is redrawing the whole buffer on every scroll, that
> > certainly sounds like the first thing to address.
> 
>    Scintilla should not be drawing the whole buffer on every scroll. The
> ScrollText method blits the common text and then draws the exposed portion.
> However, there is some deep gdk/x contributed code here which does a
> gdk_gc_set_exposures(gc, TRUE); and then a loop (now disabled for GTK+ 2)
> that is essentially while (gdk_event_get_graphics_expose) gdk_event_free()

if you don't have either that or use gdk_window_scroll(), then scrolling
the scintilla buffer when it is partially offscreen isn't going to
work properly.

I'm not sure that the loop will work properly with GTK+-2.0. Even
if it does, gdk_window_scroll() will be much more efficient, since
the loop is "wait until the server finishes scrolling", while
gdk_window_scroll() plays some nice internal bookkeeping tricks.

>    The IRC transcript (sorry, couldn't work out attributions) suggests
> gdk_window_scroll but it looks to me ike this scrolls all the contents of
> the window, including the scroll bars.

If you can move the scrollbar out of the main editor window, and
use gdk_window_scroll() it will be definitely worth it.

Regards,
                                              Owen






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]