ByteArray implements #hash but not #=

Ron Teitelbaum Ron at USMedRec.com
Sun Feb 25 19:36:31 UTC 2007


Ok so I just realized that was not a very good way to test liner time.  But
I tried war and peace / 2 and got 170ms.  That's a better test then trying
the same thing 100 times.

Ron Teitelbaum
Squeak Cryptography Team Leader


> From: Ron Teitelbaum
> Sent: Sunday, February 25, 2007 2:10 PM
> 
> Hi Martin,
> 
> I dunno I've never noticed a performance problem with ByteArray #=.
> 
> | aCopy |
> aCopy := self copy.
> 
> Time millisecondsToRun: [
> 	1 to: 1000 do: [:i | self = aCopy]]
> 
> I took a 128 element byte array and ran #= a thousand times and the
> results
> were only 14ms.  The comparison time seems linear but I'm not 100% sure
> about that.  500 calls gives me 7ms.
> 
> Ok so for the fun of it I did the same thing with War and Peace by Leo
> Tolstoy.  A single comparison took 340ms.  100 times took: 34223.  That's
> pretty linear.
> 
> Most of the work we do in the cryptography team is on small byteArrays so
> it
> would be very important that we do not lose speed there from any changes
> in
> implementation.
> 
> Ron Teitelbaum
> Squeak Cryptography Team Leader
> 
> > From: Martin Kuball
> > Sent: Sunday, February 25, 2007 8:27 AM
> > Hi!
> >
> > I'm just wondering why #= is not implemented in class ByteArray.
> Wouldn't
> > it make sense to have a fast primitive for that instead of using the
> > general implementation in class SequenceableCollection?
> >
> > Martin
> >
> 
> 
> 





More information about the Squeak-dev mailing list