Skip to content

Commit 0ef4688

Browse files
zakcutnermarmeladema
authored andcommitted
Add benchmarks to README
1 parent 57a82ea commit 0ef4688

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ fn main() {
2525
}
2626
```
2727

28+
## Benchmarks
29+
30+
We ran the **[`i386` benchmarks](benches/i386.rs)** on an **HP EliteDesk 800 G2 Tower PC** with an **Intel Core i7-6700 Processor @ 3.40GHz**, **16GB of RAM** and **512GB** of disk space, running **Ubuntu 20.04.1 LTS**, **gcc 9.3.0** and **Rust 1.46.0**.
31+
32+
| **Library** | **Version** | **Function** | **Short haystack** | **Long haystack** |
33+
| ------------------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | ----------------------------------- |
34+
| [std](https://doc.rust-lang.org/std/) | 1.46.0 | [`String::find`](https://doc.rust-lang.org/1.46.0/std/string/struct.String.html#method.find) | [335.32 ms 335.56 ms 335.83 ms] | [344.62 ms 345.01 ms 345.52 ms] |
35+
| [memmem](https://github.com/jneem/memmem) | 0.1.1 | [`TwoWaySearcher::search_in`](https://docs.rs/memmem/0.1.1/memmem/struct.TwoWaySearcher.html#method.search_in) | [87.927 ms 88.029 ms 88.151 ms] | [401.40 ms 401.59 ms 401.81 ms] |
36+
| [twoway](https://github.com/bluss/twoway) | 0.2.1 | [`find_bytes`](https://docs.rs/twoway/0.2.1/twoway/fn.find_bytes.html) | [274.60 ms 274.82 ms 275.07 ms] | [146.32 ms 146.44 ms 146.58 ms] |
37+
| [sse4-strstr](https://github.com/WojciechMula/sse4-strstr)¹ | 0.0.0-9308a59 | [`avx2_strstr_v2`](https://github.com/WojciechMula/sse4-strstr/blob/9308a59891f694f63ad6e55e387d244ea7ca4209/avx2-strstr-v2.cpp#L201) | [75.389 ms 75.515 ms 75.682 ms] | [38.521 ms 38.579 ms 38.649 ms] |
38+
| **[sliceslice](https://github.com/cloudflare/sliceslice-rs)** | **0.2.0** | **[`DynamicAvx2Searcher::search_in`](https://docs.rs/sliceslice/0.2.0/sliceslice/x86/enum.DynamicAvx2Searcher.html#method.search_in)** | **[79.283 ms 79.416 ms 79.596 ms]** | **[35.135 ms 35.181 ms 35.247 ms]** |
39+
40+
¹ sse4-strstr is not memory safe as it can read beyond the end of the haystack, please see the documentation for sliceslice where this is discussed in more detail.
41+
42+
![Benchmarks results column chart](benchmarks.svg)
43+
2844
## Licensing
2945

3046
Licensed under the MIT license. See the [LICENSE](LICENSE) file for details.

benchmarks.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)