3.8 UI performance drop?

Ned Konz ned at squeakland.org
Sat Dec 4 16:53:08 UTC 2004


On Friday 03 December 2004 4:56 pm, Jon Hylands wrote:
> On Fri, 3 Dec 2004 16:11:24 -0800, Ned Konz <ned at squeakland.org> wrote:
> > Have you tried profiling, then?
> >
> > Is the performance worse or better than with (a) other TrueType fonts, or
> > (b) bitmap fonts?
>
> Attached are two profiles, of typing a short sentence in a code window.
>
> The first, profile-1.txt is with a TTC font. 

Actually, that's an FT2 font. Have you also tried a TTC font? I'd suspect 
that'd be slower.

> The second is using Accugen, 
> which is a bitmap font. The difference is striking.

Yes, it looks like there's some stupid code in there. Especially this bit:

15.4% {1254ms} DisplayScanner(CharacterScanner)>>setFont
[[      15.0% {1222ms} FT2Font>>emphasized:
[[        15.0% {1222ms} FT2Font class>>installedFT2FontLike:withEmphasis:
[[          12.6% {1026ms} TextStyle class>>actualTextStyles
[[            7.9% {644ms} Dictionary>>select:
[[              |6.6% {538ms} Dictionary>>add:
[[              |  4.4% {358ms} Dictionary(Set)>>atNewIndex:put:
[[              |    3.6% {293ms} Dictionary(Set)>>fullCheck
[[              |      3.2% {261ms} Dictionary(Set)>>grow
[[            3.8% {310ms} Character(Object)>>isKindOf:
[[              2.1% {171ms} Character class(Behavior)>>inheritsFrom:

.. later ..

[[7.8% {635ms} DisplayScanner>>setFont
[[  7.7% {627ms} DisplayScanner(CharacterScanner)>>setFont
[[    7.5% {611ms} FT2Font>>emphasized:
[[      7.5% {611ms} FT2Font class>>installedFT2FontLike:withEmphasis:
[[        6.5% {529ms} TextStyle class>>actualTextStyles
[[          4.2% {342ms} Dictionary>>select:
[[            3.4% {277ms} Dictionary>>add:

for a total of half of the non-idle time in FT2Font>>emphasized: , when the 
FT2Font could just cache the various emphasized fonts rather than searching 
every time. And why setStopConditions should be called twice, I don't know. 

However, what may be dominating the overall real time in some cases 
(especially with slower graphics systems) is excessive redrawing.

If you turn on the preference that displays the invalidations 
(debugShowDamage) and type, does the whole TextMorph flash for every 
character? If so, there's way too much invalidation (and hence redrawing) 
going on. Really, we only need to invalidate what changed for each character.

The way we currently have things set up, we do redraw the whole textMorph 
anyway; this is way too much redrawing. This is probably one of the reasons 
why typing in Morphic is painfully slow on my 131MHz WinCE machine.

In general we only need to invalidate the last character and the text caret 
while typing; the paragraph has these bounds anyway.

In the case of Shout, it should analyze what characters got re-colored, and 
only invalidate the area(s) covered by those characters.  But that assumes 
that TextMorph gets fixed to avoid over-invalidating.

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list