MacOSX Performance

Tim Rowledge tim at sumeru.stanford.edu
Sun Jan 23 00:08:36 UTC 2005


As a warning about taking care when measuring these things, consider the
following:-
On my machine (a 600MMz Intel XScale with 100MMz memory, teensy caches
and no FPU, PCI nVidia graphics, RISC OS etc) the original example
usingthe Time Profiler took 646 sec. It claimed that 3% was spent in
Pen drawr-something-or-other. From that one would think that maybe the
floating point arithmetic was the expensive part, what with no FPU
around.
However, cutting the hilbert depth to 7 to save some time, try a
different way of measuring it. I did 
Time millisecondsToRun:[
	| b |
	b _ Pen new.
	Display fillWhite.
	b place:(Display boundingBox bottomLeft).
	b hilbert: 7 side: 2]
and got 37716 ie 38 secs.
Now, add in a dispaly deferment
Time millisecondsToRun:[Display deferUpdatesIn: Display boundingBox while: [
	| b |
	b _ Pen new.
	Display fillWhite.
	b place:(Display boundingBox bottomLeft).
	b hilbert: 7 side: 2] ]
and I get..... 4130 ie 4sec. Thus we conclude that a very significant
amount ot time is spent doing the screen freshing.
Just to do extra checking (since my OS has to check all events in the
getNextEvent prim to do a display update) I put another OS window over
the are being hilberted so that the display update wouldn't be declared
since the affected area is hidden (unlike many UIs RISC OS windows
don't need to be at the front to be live or even have keyboard focus).
Thus we get the event processing and the copying of pixels from the
Squeak Dispaly to the OS backing store(with pixle reversal and RGB to
BGR swapping) but no actual displaying. For that case I got 6055 ie
6sec.

Thus I am forced to the conclusion that about 84% of my time for this
test is being spent on moving pixels from main memory to PCI grapics
card memory. Bugger :-(

And worse, note the subtle difference between 3% and 84%

tim
--
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- Ought to have a warning label on his forehead.



More information about the Squeak-dev mailing list