[Seaside-dev] String >> #=

Philippe Marschall philippe.marschall at gmail.com
Sun Jun 1 15:55:55 UTC 2014


Hi

I am currently looking at your dictionary look up performance [1]. We
use GRSmallDictionary instead of Dictionary in a lot of places with
string keys (request and response headers, url query fields, …).
Unfortunately on Squeak/Pharo with 11 keys Dictionary is twice as
fast. The reason seems to be that String >> #= is quite slow on
Squeak/Pharo especially with prefix matches. Special casing string
keys and first sending and comparing #size before #= seems to fix this
and make GRSmallDictionary again slightly faster than Dictionary.

Before I take any action I wanted to ask how String >> #= is
implemented in other dialects
 * Do any dialects first compare #size before iterating over the characters?
 * Do any dialects do Unicode normalization in String >> #=?
 * Do any dialects implement String >> #= in a way such that two
strings with different sizes could be considered equal (eg. because
they do normalization)?

 [1] https://code.google.com/p/seaside/issues/detail?id=793

Cheers
Philippe


More information about the seaside-dev mailing list