[squeak-dev] The Inbox: Chronology-Core-dtl.56.mcz
David T. Lewis
lewis at mail.msen.com
Sun Sep 6 00:44:39 UTC 2020
On Fri, Sep 04, 2020 at 10:10:21PM -0400, David T. Lewis wrote:
> On Fri, Sep 04, 2020 at 09:04:08PM -0400, David T. Lewis wrote:
> >
> > On Sat, Sep 05, 2020 at 12:01:21AM +0200, Levente Uzonyi wrote:
> >
> > > 2) Some replacement methods are not quick and create new objects. For
> > > example, OneDay, a single Duration of one day is replaced with #oneDay, a
> > > method returning the expression 1 day. Each invocation of the method
> > > creates a new object.
> > > In my image, there are 19821 Date instances. If all of those had their own
> > > custom one day long Duration objects, which is a side effect of these
> > > changes in the long run, my image would be ~620 kiB larger (64-bit image,
> > > object header + 2 variables => 32 bytes each).
> > > There's a solution: cache the shared instance in a variable. :)
> >
> > If it is a problem, then this is an error on my part (not Juan's). After
> > adopting the main part of the Cuis changes, #oneDay was one of a couple
> > of remaining cases that I addressed with trivial replacements.
> >
> > But there are no senders of #oneDay in the image other than a unit test.
> > So I think that it is not likely to be an issue.
> >
>
> Levente,
>
> My apologies, I was careless and you are right. Duration class>>oneDay is
> sent by Date class>>starting: and therefore it does create redundant new
> objects exactly as you said.
>
> This is an error on my part and would need to be fixed before the changes
> could be considered for trunk.
>
I moved Chronology-Core-dtl.56 to the treated inbox, and put
Chronology-Core-dtl.58 in the inbox to address the #oneDay issue.
Dave
More information about the Squeak-dev
mailing list
|