StrikeFontSet question
Eddie Cottongim
cottonsqueak at earthlink.net
Wed Aug 3 06:06:02 UTC 2005
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.
Thanks,
Eddie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StrikeFontExperiment-efc.1.cs.gz
Type: application/octet-stream
Size: 249 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20050803/4c96dabd/StrikeFontExperiment-efc.1.cs.obj
More information about the Squeak-dev
mailing list
|