[Etoys] Slow etoys project loading for EPaati

karl karl.ramberg at comhem.se
Thu Feb 7 04:34:04 EST 2008

Luke Gorrie wrote:
> So it seems to have been fairly easy to more than double the speed of
> loading our slowest-loading project (names of colors.pr), but I'm not
> certain that the fix is correct. The logic seems right but I've
> noticed Squeak getting wedged with 100% CPU usage and I'm not sure
> whether my change is causing this.
Squeak and Morphic has a long history of doing this and it should be fixed.
> The change is to hack ImageSegment>>restoreEndianness to more
> efficiently rehash MethodDictionary objects. MethodDictionary>>rehash
> uses #become: and that's expensive -- on my 1.6Ghz machine #become:
> takes about 50ms on each of our hundreds of instances. Taking a cue
> from the 'Back to the Future' paper [*] it seems like a good idea to
> combine all of the #become:'s into a batch so that the heap is only
> traversed once, like this:
> ImageSegment>>rehashMethodDictionaries: oldDictionaries
>     | newDictionaries |
>     newDictionaries := oldDictionaries collect: [:d | d rehashWithoutBecome].
>     oldDictionaries asArray elementsForwardIdentityTo: newDictionaries asArray.
> This pulls the loading time of that project on the XO down from 3.5
> minutes to 1.5 minutes, which is still too slow but progress is
> progress :-)
That is impressive speed up.
> ChangeSet attached! Can someone who Knows say if it looks right?
> Cheers,
> -Luke (torn between speed vs. memory profiling next)
> P.S. Thanks Bert for the profiling tutorial :-)
Can the profiling tutorial be shared somehow ?
> [*]: http://www.s1on1.com/main/index.cgi/000000A/http/users.ipa.net/~dwighth/squeak/oopsla_squeak.html
> ------------------------------------------------------------------------
> _______________________________________________
> Etoys mailing list
> Etoys at lists.laptop.org
> http://lists.laptop.org/listinfo/etoys

More information about the Etoys mailing list