[ENH] Speed boost for hierarchical lists

Bob Arning arning at charm.net
Wed Oct 6 16:37:27 UTC 1999


The following changeset can provide a *major* speed boost in cases where you collapse an item in a hierarchical list with many thousands of sub-items.

Cheers,
Bob

========
'From Squeak 2.5 of August 6, 1999 on 6 October 1999 at 12:29:24 pm'!
"Change Set:		MorphRemove
Date:			6 October 1999
Author:			Bob Arning

A significant speed-up in Morph>>removeAllMorphsIn: when dropping large numbers of submorphs (e.g. when collapsing an item in a hierarchical list with thousands of subelements)"!


!Morph methodsFor: 'submorphs-add/remove' stamp: 'RAA 10/6/1999 12:23'!
removeAllMorphsIn: aCollection
"greatly speeds up the removal of *lots* of submorphs"
	| set |
	self changed.
	aCollection do: [:m | m privateOwner: nil].
	set _ IdentitySet new: aCollection size * 4 // 3.
	aCollection do: [:each | set add: each].
	submorphs _ submorphs reject: [ :each | set includes: each].
	self layoutChanged.
! !





More information about the Squeak-dev mailing list