[squeak-dev] The Inbox: Collections-ct.995.mcz

Levente Uzonyi leves at caesar.elte.hu
Mon Mar 28 18:30:06 UTC 2022


Hi Christoph,

Please check Collections-ul.1000 in the Inbox.


Levente

On Fri, 25 Mar 2022, Thiede, Christoph wrote:

> 
> Hi Levente,
> 
> 
> thanks for the feedback! The atomicity is a good point, I will document this in a comment.
> 
> 
> > On my machine it takes 40-60ms for the original method to finish. Is that too slow?
> 
> 
> In the majority of situations, probably not. :-)
> 
> My use case was a bit special: I am running large code sections in the simulator, which includes sends to Symbol class cleanUp: or Symbol class shutDown:. Inside the simulator, #condenseNewSymbols is significantly more
> expensive. In this context, I can run "Symbol condenseNewSymbols" right before starting the simulator, but this only speeds up the simulation if any follow-up send to #cleanUp: or #shutDown: will not condense/compress the
> tables again.
> 
> 
> I have just uploaded Collections-ct.996 to the inbox, what do you think about it? :-)
> 
> 
> Best,
> 
> Christoph
> 
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Levente Uzonyi <leves at caesar.elte.hu>
> Gesendet: Sonntag, 13. März 2022 22:41:48
> An: squeak-dev at lists.squeakfoundation.org
> Betreff: Re: [squeak-dev] The Inbox: Collections-ct.995.mcz  
> Hi Christoph,
> 
> #condenseNewSymbols expects that the first two assignments happen
> atomically. Using #ifEmpty: and creating a block will introduce suspension
> points, hence atomicity will not be ensured.
> 
> Despite its name, the method also compacts SymbolTable as it is stated
> in the method comment. That would not be true with your change.
> 
> On my machine it takes 40-60ms for the original method to finish. Is that
> too slow? If yes, it can be sped up but a different method needs to
> be changed.
> 
> 
> Levente
> 
> On Sat, 12 Mar 2022, commits at source.squeak.org wrote:
> 
> > A new version of Collections was added to project The Inbox:
> > http://source.squeak.org/inbox/Collections-ct.995.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Collections-ct.995
> > Author: ct
> > Time: 12 March 2022, 2:46:24.947632 am
> > UUID: 9c697903-e2ac-2244-85cb-5234b3a3c9ca
> > Ancestors: Collections-mt.994
> >
> > Accelerates Symbol condenseNewSymbols if there are no new symbols.
> >
> > =============== Diff against Collections-mt.994 ===============
> >
> > Item was changed:
> >  ----- Method: Symbol class>>condenseNewSymbols (in category 'private') -----
> >  condenseNewSymbols
> >        "Move all symbols from NewSymbols to SymbolTable, and compact SymbolTable."
> >
> >        | originalNewSymbols originalSymbolTable newNewSymbols newSymbolTable |
> > +      originalNewSymbols := NewSymbols ifEmpty: [^ self].
> > -      originalNewSymbols := NewSymbols.
> >        originalSymbolTable := SymbolTable.
> >        newNewSymbols := WeakSet new.
> >        newSymbolTable := originalSymbolTable copy
> >                addAll: originalNewSymbols;
> >                compact;
> >                yourself.
> >        originalNewSymbols == NewSymbols ifFalse: [
> >                "Some other process has modified the symbols. Try again."
> >                ^self condenseNewSymbols ].
> >        NewSymbols := newNewSymbols.
> >        SymbolTable := newSymbolTable!
> 
> 
>


More information about the Squeak-dev mailing list