StrikeFontSet question

Chris Schreiner chris.schreiner at online.no
Wed Aug 3 09:30:15 UTC 2005


Eddie Cottongim wrote:

> I noticed that StrikeFontSet>>displayString: on: from: to: at: kern: 
> baselineY: is very heavily used, and isn't using the primitive BitBlt 
> provides. I am guessing there is some reason for this, possibly 
> internationalization related, but if we could find a way to get the 
> primitive to do it there would be some performance benefits. The 
> primitive seems to have about twice the raw drawing speed of the 
> current version, though in some situations its much more.
>
> I stuck the call to BitBlt in there, and it seemed to work fine, so I 
> tried Dan's infamous 10 browser test.
>
> time _ 0.
> saveMorphs _ self currentWorld submorphs.
> 5 timesRepeat:[
> self currentWorld removeAllMorphs.  "heh, heh"
> time _ time + (Time millisecondsToRun:
> [
>    1 to: 10 do: [:i | Browser fullOnClass: SystemDictionary selector: 
> #abandonSources].
>    self currentWorld submorphs do: [:m | m delete. self currentWorld 
> doOneCycle]]).
> ].
> self currentWorld addAllMorphs: saveMorphs.
> time/5 asFloat
>
> Times in milliseconds:
> 10551.6   <- current 3.8 version
> 9758.2       <- using the primitive
>
> Thats about 10% improvement from one method in a real world situation, 
> and may explain where some of the speed has gone in the last couple of 
> years.
>
> Advice, comments appreciated. Code attached if you want to see what I 
> was trying.
>
Hi there, this is interesting...

Running this on a 2.8 ghz 1gb XP box:

13185.6 ms <- using a 3.9 alpha
13282.6 ms <- using the primitive

What gives?

Chris Schreiner




More information about the Squeak-dev mailing list