Skip to content

Commit

Permalink
Approach 09: Use memchr and loop instead of split (71s)
Browse files Browse the repository at this point in the history
Use memchr instead of split. memchr uses SIMD for faster seraching of
needle in the haystack. The split function is slow because it contructs
the split parse everytime it is called.

Few links to read more:
* https://github.com/BurntSushi/memchr
* https://blog.burntsushi.net/bstr/#motivation-based-on-performance
  • Loading branch information
Naveenaidu committed Jul 14, 2024
1 parent 38bdd01 commit d24e56f
Show file tree
Hide file tree
Showing 3 changed files with 527 additions and 32 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ rust_decimal_macros = "1.34"
fast-float = "0.2"
rustc-hash = { version = "1.0"}
memmap2 = {version = "0.9.4"}
memchr = { version = "2", default-features = false }
Loading

0 comments on commit d24e56f

Please # to comment.