[squeak-dev] The Trunk: Morphic-mt.1549.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Tue Oct 1 07:41:06 UTC 2019


Hi Tim,

having no filter, "fullList" is the identical cache as "list" has been for a while now:

PluggableListMorph >> #getList
   ...
   list := self getFullList.
   ...

The "list" cache will be different once you start filtering items:

PluggableListMorph >> #filterList
   ...
   list := newList.
   ...

In the LazyListMorph, there is another cache, which builds up from "list" items that have been drawn at least once:

LazyListMorph >> #item:
   ...
   listItems at: index put: newItem
   ...

That last cache is probably not necessary but I think it is a good idea to keep PluggableListMorph and LazyListMorph decoupled in the sense that they do not rely on each other's caches. At least the reason for caching is different:

- PluggableListMorph caches "list" and (now) "fullList" to speed up filtering
- LazyListMorph caches "listItems" to speed up drawing

Note that cache invalidation happens here:

LazyListMorph >> #listChanged
PluggableListMorph >> #getList (! really tricky !)
PluggableListMorph >> #update: (from changed/update and see #updateList:)

For millions of items, that new cache of "fullList" does not make memory consumption that worse ... maybe a little bit if you start applying a filter. Then, "fullList" and "list" might share a substantial amount of elements. Then again, how expensive is "Array new: 10000000" anyway? The items themselves are not copied.

Best,
Marcel

Am 30.09.2019 19:36:06 schrieb tim Rowledge <tim at rowledge.org>:


> On 2019-09-30, at 2:19 AM, commits at source.squeak.org wrote:
>
>
> Caches "fullList" in pluggable lists to speed up list filtering.

Does this interact with LazyList (or whatever its called - not in front of an image I can check) and what happens if the full list is millions of items?

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: RBT: Rewind and Break Tape



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191001/f3bdf0ee/attachment-0001.html>


More information about the Squeak-dev mailing list