Hi Igor,

    is the NB implementation mapping the character codes in the wide strings into Character objects and taking the character hashes?  If so, very cool.  The NB code is very fast.  If on the other hand you're just short-circuiting the character code lookup then you're cheating :)

On Fri, May 14, 2010 at 3:31 PM, Igor Stasenko <siguctua@gmail.com> wrote:
Oh, yeah..
i forgot to hash the strings.. for comparison:

|ss s t1 t2 t3 |
s := (WideString with: (Character value: 16r55E4)) , 'abcdefghijklmno'.
ss := (String with: $z) , 'abcdefghijklmno'.

10 timesRepeat: [ s := s , s. ss := ss , ss ].
self assert: (s hash = s nbHash).
t1 := [1000 timesRepeat: [s hash]] timeToRun.
t2 := [1000 timesRepeat: [s nbHash]] timeToRun.
t3 := [1000 timesRepeat: [ss hash]] timeToRun.
{ t1. t2. t3 }
 #(11477 134 190)

so, WideString>>nbHash outperforms ByteString>>hash a little, for same
string sizes. ;)

--
Best regards,
Igor Stasenko AKA sig.