<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Hi Tim,<div><br></div><div>having no filter, "fullList" is the identical cache as "list" has been for a while now:</div><div><b><br></b></div><div><b>PluggableListMorph >> #getList</b></div><div><b>   ...</b></div><div><b>   list := self getFullList.</b></div><div><b>   ...</b></div><div><br></div><div>The "list" cache will be different once you start filtering items:</div><div><br></div><div><b>PluggableListMorph >> #filterList</b></div><div><b>   ...</b></div><div><b>   list := newList.</b></div><div><b>   ...</b></div><div><br></div><div>In the LazyListMorph, there is another cache, which builds up from "list" items that have been drawn at least once:</div><div><br></div><div><b>LazyListMorph >> #item:</b></div><div><b>   ...</b></div><div><b>   listItems at: index put: newItem</b></div><div><b>   ...</b></div><div><br></div><div>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:</div><div><br></div><div><b>- PluggableListMorph caches "list" and (now) "fullList" to speed up filtering</b></div><div><b>- LazyListMorph caches "listItems" to speed up drawing</b></div><div><br></div><div>Note that cache invalidation happens here:</div><div><br></div><div><b>LazyListMorph >> #listChanged</b></div><div><b>PluggableListMorph >> #getList (! really tricky !)</b></div><div><b>PluggableListMorph >> #update: (from changed/update and see #updateList:)</b></div><div><br></div><div>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 "<b>Array new: 10000000</b>" anyway? The items themselves are not copied.</div><div><br></div><div>Best,</div><div>Marcel</div><div><br></div><div class="mb_sig"></div>
                                        
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 30.09.2019 19:36:06 schrieb tim Rowledge <tim@rowledge.org>:</p><div style="font-family:Arial,Helvetica,sans-serif"><br><br>> On 2019-09-30, at 2:19 AM, commits@source.squeak.org wrote:<br>> <br>> <br>> Caches "fullList" in pluggable lists to speed up list filtering.<br><br>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?<br><br>tim<br>--<br>tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim<br>Strange OpCodes: RBT: Rewind and Break Tape<br><br><br><br></div></blockquote></div>