Re: [scintilla] Pango support on GTK+ 2.x
- From: "Neil Hodgson" <nhodgson bigpond net au>
- To: "Owen Taylor" <otaylor redhat com>
- Cc: "Havoc Pennington" <hp redhat com>, "Biswapesh Chattopadhyay" <biswapesh_chatterjee tcscal co in>, "Scintilla Interest" <scintilla-interest lyra org>, "GTK Devel" <gtk-devel-list gnome org>
- Subject: Re: [scintilla] Pango support on GTK+ 2.x
- Date: Tue, 11 Mar 2003 08:20:52 +1100
Owen Taylor:
> - I'm not sure it will be faster currently, but I'd definitely
> suggest using one layout per line and setting color attributes
> on ranges.
That turned out to be slightly (~5%) slower. Possibly it was the extra
allocation and setup of a font description and colour attribute for each
run.
> - Is the problem layout speed or rendering speed? I'd guess that
> scintilla can assume constant-height-lines, but perhaps
> it still needs to go over the entire file to deal with
> line widths. (or if there is wrapping involved)
Layout speed appears the big problem. Scintilla performs two runs over
text to be displayed, the first to measure the text and the second to render
the text. The measurement is required to perform wrapping as you say. The
results of the measurement are placed in a 'line layout' cache so most
editing can use the previously calculated positions. My tests here have
mostly been with maximum caching turned on but without wrapping. The
measurement is lazy and normally only occurs when a line needs to be
measured for display. Wrapping often requires measuring the whole file.
There is certainly a cost to performing the layout twice and I could attempt
to defer position calculations under some conditions to render time.
> - It takes GtkTextView around 1.5s to lay out a 11,000 line
> source file on 1 ghz machine.
My result was a 190K, 6000 line source code file taking about 8 seconds
to completely lay out on a 600MHz Athlon running RedHat 8.0 with its default
GTK+, X and font system.
> - If layout is the bottleneck, then one useful optimization
> is that when doing the layout (but not the rendering),
> omit the color attributes.
OK.
Neil
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]