in reply to Re: suffix array efficiency
in thread suffix array efficiency

Popped it in the benchmark, just for fun. Suffers from Out of memory! at large strings (like RobertCraven's original), but fastest of the full string comparisons:
20000 26 20 Rate hdb RobertCraven sortPosns kennethk + xxx hdb 2.73/s -- -15% -41% -55% + -84% RobertCraven 3.20/s 17% -- -31% -48% + -81% sortPosns 4.61/s 69% 44% -- -24% + -73% kennethk 6.11/s 124% 91% 32% -- + -64% xxx 17.1/s 527% 435% 271% 180% + -- 20000 4 20 Rate hdb RobertCraven sortPosns xxx + kennethk hdb 2.95/s -- -10% -36% -43% + -52% RobertCraven 3.29/s 11% -- -29% -36% + -46% sortPosns 4.63/s 57% 41% -- -10% + -25% xxx 5.15/s 74% 57% 11% -- + -16% kennethk 6.13/s 108% 87% 33% 19% + --

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.