[Q] scrolling large collections

Ned Konz ned at bike-nomad.com
Wed Apr 9 20:48:09 UTC 2003


On Wednesday 09 April 2003 01:33 pm, Eddie Cottongim wrote:
> By the way, although an ambitious changeset like Lex's Largelists
> may not be able to gain favor from n squeakers (gaining such
> acceptance would seem to be an O(N!) problem) we could do some
> minor things to help ScrollPane.
>
> Specifically, on every scroll it iterates through all its morphs (
> I think i'm getting this right!) to find their bounds. This as far
> as I can tell can be cached very reasonably to at least double the
> scrolling speed. Calculate it lazily, and invalidate it upon a
> #layoutChanged. This isn't a total speed fix but its simple and a
> considerable increment.
>
> If anyone is interested in such changes I'll prepare them (its
> perhaps 2 one-liners), but I'm inclined to believe no one is. Of
> course if I'm overlooking something fundamental please let me know.

You must mean that Lex's change set does this. The stock code, as I'm 
sure you know, just iterates through the morphs and draws each one to 
a clipping canvas.

It seems to me like the behavior of the stock drawing code can be made 
a lot faster with large lists by a simple addition to ClippingCanvas:

fullDrawMorph: m
	(self isVisible: m fullBounds) ifFalse: [ ^self ].
	super fullDrawMorph: m

However, I haven't benchmarked it myself.

Does anyone have a good benchmark for redrawing browsers (for 
instance)? I think Andreas had posted something like that a while 
ago.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list