4 suggested fixes/enhs for 3.9.1 (was Re: 3.9.1 (was: Re: Preliminary new Yaxo version))

goran at krampe.se goran at krampe.se
Thu Nov 15 11:16:06 UTC 2007

Hi folks!

A few things for possible inclusion, I don't have time right now to
check if some of these are already included but I think not.

Two of them are nice speedups (time and printing SmallIntegers), the
other one is a simple addition of behavior (parsing dates) that I wrote
as a reaction to a post on the beginners list a while back. Oh, and I
also added a fix for SMTPClient - well, two rolled into one changeset
actually - harvested from the Gjallar project.

I consider 6513 to be trivial to add (just added behavior - can't break
stuff), 6512 seems trivial too (easy to verify), 4669 should be green
with all Date/Time tests and has been recommended for inclusion earlier,
but perhaps someone else did something in that area that has made it
obsolete (Keith?), I don't recall. 6768 also seems easy to include, and
it has been battle tested in Gjallar.

regards, Göran


Much faster printString (and thus also asString) for SmallIntegers: 
One override of #printString for SmallInteger and a new method for
counting digits in base 10. This makes #printString for SmallIntegers
more than 4 times faster than before.

  	 Read a Date from the stream based on the pattern which can include
the tokens:
        y = A year with 1-n digits
        yy = A year with 2 digits
        yyyy = A year with 4 digits
        m = A month with 1-n digits
        mm = A month with 2 digits
        d = A day with 1-n digits
        dd = A day with 2 digits
    ...and any other Strings inbetween. Representing $y, $m and $d is
done using
    \y, \m and \d and slash itself with \\. Simple example patterns:


    A year given using only two decimals is considered to be >2000.

Ok, so we were trying to figure out why our logger in Gjallar spent so
much time in creating DateAndTime etc... after looking, tweaking,
profiling and even some thinking I came up with this "SpeedPack" of

I might have broken some subtleties (I don't think I have though) but
the tests are still green. Glad for any indepth review.

And? Well, the speed differences are quite huge. :) Lots of it comes
from better Duration instance creation methods and from not going back
and forth too much between nanos and seconds etc.

"DateAndTime now" is about 6 times faster and "Date today" 4 times. The
full chronology test suite runs almost 2 times faster. See preamble for
a do-it that shows this (run before and after installing cs).

So far only tested in 3.8.

Added support for EHLO (sending SMTP using Exchange) and fixed a problem
with authentication - #initiateSession needs to be sent before login

More information about the Squeak-dev mailing list