faster splitter

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri May 27 13:50:52 PDT 2016


On 05/27/2016 04:39 PM, qznc wrote:
> Now added Chris' algo to the benchmark:
>
> std find:    155 ±33
> manual find: 112 ±19
> qznc find:   122 ±18  <--- improved find
> Chris find:  133 ±20  <--- findStringS_

Does any of these feature simultaneously:

* check the last element first
* consequently stop early when the length of the haystack falls below 
the length of the needle
* consequently no check against the haystack limit is necessary in the 
inner loop
* use only one induction variable

?


Andrei


More information about the Digitalmars-d mailing list