DateTime's and LargeIntegers

Ross Boylan RossBoylan at stanfordalumni.org
Thu Jul 1 05:20:45 UTC 2004


On Mon, Jun 28, 2004 at 11:40:35PM -0700, Ned Konz wrote:
> On Monday 28 June 2004 10:32 pm, Ross Boylan wrote:
> >
> > So does this mean that the crummy performance I've been getting is
> > with the assistance of the plugin?
> 
> I don't know. Maybe.
> 
> If you can send a profile log to the list, maybe someone could suggest 
> something.

The message tallies I have don't seem to have good options for
export.  Is there a good way to do that?

For reasons given below, the absence of the profile will probably not
be a great loss.

> 
> Look at suspect LargeInteger methods and see if they call the primitives.

Good point.  On inspection, none of them do.  For example, 30% if the
total time is in LargeNegativeInteger(Integer)>>quo:.  The (Integer)
there is, of course, another clue that the LargeInteger plugin isn't
involved. :)

Somewhat surprisingly, SmallInteger(Integer)>>+ is also using a lot of 
time.

> 
> You can comment out the primitive calls in specific methods if you want to see 
> how much slower it is *without* the plugin.
> 
> But usually it's not the fault of the plugin in cases like this. It sounds to 
> me like maybe there's too much garbage collection going on, or too many 
> unnecessary conversions, or something.

That raise an interesting issue: how is garbage collection reflected
in the profiles?

> 
> For instance, if you're using SortedCollection for big collections of DateTime 
> instances that are being changed a lot, you should probably be using some 
> other kind of collection that's more efficient.
> 

Probably the right thing for me to do in this case is look higher up
the chain.  Specifically, the offending operation is inserting
something into an already well-populated GUI.  For simplicity, I just
blew everything away and recreated it.  It's time to look into
something a bit more refined.

I do think it would also be good to think about working on the
performance of DateAndTime, as Avi suggested--especially if it's being
used by ordinary Date's or Time's.  For example, a lot of my time is
going into simple comparison operations on DateAndTimes.  It seems to
me that's an operation that should be pretty fast.  But to do it,
asUTC gets called (necessitated in part by the fact that DateAndTime's
represent times in a specific timezone), and that's an expensive operation.



More information about the Squeak-dev mailing list