[ENH] StringMorphOptimizations-nk

ned at bike-nomad.com ned at bike-nomad.com
Fri May 11 17:40:27 UTC 2001


Noel Bergman's remarks about the slowness of bringing
up menus on his Compaq prompted me to get this out,
dust it off, and remove the more controversial/broken parts.

I believe it to be a safe, sane improvement for Morphic
String performance. On my system, I get a 28 percent
improvement in the speed of bringing up the New Morph
alphabetical menu. And browsers seem to be faster, as well.

from preamble:

"Change Set:		StringMorphOptimizations-nk
Date:			11 May 2001
Author:			Ned Konz

This speeds up browsers and menu display by deferring
the setting of StringMorph to its default string as long as
possible. In most cases, StringMorph instances are set to
something other than 'String Morph'.

There were also two duplicate 'changed' calls in StringMorph every
time that contents: was called. This fixes this to call changed
once per contents: call:

	contents:
		fitContents
			extent
				changed

These changes resulted in a speedup of 28% on popping up the
alphabeticalMorphMenu, as measured by:

wm _ TheWorldMenu someInstance.
((1 to: 20) collect: [ :i | Smalltalk garbageCollectMost. Time
millisecondsToRun: [  wm alphabeticalMorphMenu  ]]) average asFloat

"!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StringMorphOptimizations-nk.cs.gz
Type: application/octet-stream
Size: 854 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010511/f5906455/StringMorphOptimizations-nk.cs.obj


More information about the Squeak-dev mailing list