faster splitter
qznc via Digitalmars-d
digitalmars-d at puremagic.com
Fri May 27 12:52:07 PDT 2016
On Friday, 27 May 2016 at 14:41:29 UTC, Chris wrote:
> The improved `std find` comes very close to the manual function
> above now, sometimes it's even faster or at least as fast.
>
> std find took 12573666
> manual find took 7418454
> my std find took 6903854 <===
> findStringS took 7166720
> findStringS_ took 6579529 <===
I just updated my benchmark. It now checks lots of different
scenarios instead of you having to specify one. You can only set
the number of iterations now.
It generates a random scenario (haystack length, needle length,
alphabet, etc) and runs it once with all algorithms. Instead of
recording the absolute runtime, it records the slowdown compared
to the fastest of the three. Average those and also compute the
absolute deviation (the second number).
Example:
std find: 153 ±33
manual find: 112 ±19
my std find: 119 ±16
So manual find is on average 12% slower than the fastest ±19%. I
would interpret that as no significant difference between manual
and improved find.
More information about the Digitalmars-d
mailing list