TimeForSpeed

goran at krampe.se goran at krampe.se
Thu Aug 31 11:45:10 UTC 2006


Hi!

Bert Freudenberg <bert at freudenbergs.de> wrote:
> goran at krampe.se schrieb:
> > Hi!
> > 
> > Just posted this ENH on Mantis making "DateAndTime now" 6 times faster
> > (and lots, lots more):
> > 
> > 	http://bugs.impara.de/view.php?id=4669
> > 
> > ...enjoy. And please review.
> 
> Great that someone is looking into this!
> 
> There are other gross inefficiencies in there, like that every Date
> instance stores a duration with nano-second precision. See
> 
> http://article.gmane.org/gmane.comp.lang.smalltalk.squeak.general/100427
> 
> - Bert -

Right. I haven't looked into all this enough to give any judgement on
the design - I just did "behaviour preserving refactorings" to get
speed. It would be nice if someone could summarize all Time related
classes and when to use which one. There is plenty of them these days.
:)

For example, Date as you mention seems IMHO also like it still could be
stored as a julian day number. A "Date beast" with duration etc seems
like it probably could be called a Day instead. A Date does not in my
mind represent a "specific historic period", but I am no expert of
course.

regards, Göran

PS. We also use the Timezone stuff from David Lewis and that also ties
into this using class PointInTime etc. Phew. One thing we found is that
David added a small "daemon" process that keeps track of "now" and that
can very quickly give back an instance. But it wasn't hooked into the
general machinery so it was just sitting there. :) We hooked it in and
it seems to work - though I am unsure if it turned out faster than the
ENH I posted - I don't think so.



More information about the Squeak-dev mailing list