Re: [vwnc] [VW7.7nc] Low performance of UnicodeCollationAlgorithm
Yes, the Unicode collation algorithm is quite slow. It needs
to do some fairly complicated things, especially normalizing characters.
We may end up moving some of that into a primitive. The benefity of the
Unicode Collation Algorithm is that it actually gets the right answers.
However, if you know that the strings you're comparing don't exhibit
those complexities, or you're not that fussy about the exact sorting of
code point E9 as compared to code point 65 followed by B4, then you can
call a method like trueCompare:, which is much faster and simpler. And if
you think that's the case globally, then you can set the collation policy
on your locale, or on StringCollationPolicy.
At 08:43 AM 2010-01-22, VAM wrote:
Next code:
words := OrderedCollection new.
1 to: 10e4 do: [:each | words add: 'aaa'].
For 7.6nc
Time millisecondsToRun: [words sorted] 66
For 7.7nc
Time millisecondsToRun: [words sorted] 3502