• Home
Name Date Size #Lines LOC

..--

README.mdD07-Sep-20241.3 KiB2520

haystack.txtD07-Sep-20241,000 11

i386-notutf8.txtD07-Sep-2024837.3 KiB20,85515,677

i386.txtD07-Sep-2024787.9 KiB20,85515,385

words.txtD07-Sep-202434.5 KiB4,5864,585

README.md

1These benchmark inputs were taken from the sliceslice [project benchmarks][1].
2
3These inputs drive two benchmarks, one on short haystacks and the other on long
4haystacks, with a slightly unusual but interesting configuration. Neither of
5these benchmarks include the time it takes to build a searcher. They only
6measure actual search time.
7
8The short haystack benchmark starts by loading all of the words in `words.txt`
9into memory and sorting them in ascending order by their length. Then, a
10substring searcher is created for each of these words in the same order. The
11actual benchmark consists of executing each searcher once on every needle that
12appears after it in the list. In essence, this benchmark tests how quickly the
13implementation can deal with tiny haystacks. The results of this benchmark tend
14to come down to how much overhead the implementation has. In other words, this
15benchmark tests latency.
16
17The long haystack benchmark has a setup similar to the short haystack
18benchmark, except it also loads the contents of `i386.txt` into memory. The
19actual benchmark itself executes each of the searchers built (from `words.txt`)
20on the `i386.txt` haystack. This benchmark, executing on a much longer
21haystack, tests throughput as opposed to latency across a wide variety of
22needles.
23
24[1]: https://github.com/cloudflare/sliceslice-rs
25