Browser on slower machines

Eddie Cottongim cottonsqueak at earthlink.net
Sat Jul 26 18:24:32 UTC 2003


Hi,

I've been noticing that on my slower machine, the Browser is quite slow. If
I open up all the Morph methods and click or use the arrow keys to move
through them, it takes about two seconds to display each new method.

I'm finding that for each new method selection by arrow key/mouse click,
ClassOrganizer>>allMethodSelectors gets called 4 times. This requests that
the message list be sorted, and that takes a bit of time, about 50% of the
total time spent updating.

It seems like we can cache the sorted version of the list, but you need to
be careful to invalidate the cache when the original (elementArray) changes.
I've created a private accessor method for elementArray that does this, and
replaced the original direct writes to this variable with calls to the
private accessor. Its actually quite rare that elementArray needs to be
resorted after being created - usually when a method is added or removed. So
far it seems to handle these events fine.

I don't claim to be any kind of expert in this area, so if anyone wants to
see if this makes sense that would be great. If there are no big problems
I'll repost as [ENH] later. Should make the biggest difference for the PDA
crowd.. others may not notice it much.

Benchmarks..
On the slow (~133mhz) machine, browsing through Morph all methods, this
change got me from about 2 seconds to move from one method to another to
about half a second. On a faster (600mhz) machine, the display feels almost
synchronous with the keypress, where there was a small but palpable delay
before.

There was about a 5% improvement in MacroBenchmark #6. On faster machines
this difference will probably dissapear into the noise. You wouldn't expect
even the 5% difference, but the method was being called multiple times per
Browser and added up to something noticable.

Eddie




-------------- next part --------------
A non-text attachment was scrubbed...
Name: ClassOrganizerCache-efc.3.cs.gz
Type: application/octet-stream
Size: 2832 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030726/db08db1d/ClassOrganizerCache-efc.3.cs.obj


More information about the Squeak-dev mailing list