4 ms·
Looks great! I'm curious what the performance implications of switching to PCRE2 are.
by eridius 8y ago
Looks great!
I'm curious what the performance implications of switching to PCRE2 are.
- burntsushi 8y agoPCRE2 is opt-in. For performance, here's a start. :) https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#pcre2-slow https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#pcr...
- eridius 8y agoAh. I recommend adding a link to that FAQ entry in the README, as it currently mentions in several places that it has optional PCRE support but has zero mention of the fact that this is (usually) slower.
- dagenix 8y agoMy extremely unscientific test had PCRE2 being quite a bit slower - 1 second vs 0.2 seconds to search through 10k files - ie, slower, but still pretty darn fast.
- burntsushi 8y agoThat feels like it's in about the right ballpark based on my own tests. You can make it go a bit faster if you're using nightly Rust and compile with SIMD optimizations: RUSTFLAGS="-C target-cpu=native" cargo build --release --features 'simd-accel avx-accel pcre2' In particular, this enables SIMD optimizations in the crate ripgrep uses for decoding UTF-8, which is required to run on all files in order to use PCRE2 in Unicode mode. (Eventually, I'm hoping the SIMD optimizations in the encoding_rs crate move to using runtime detection like the regex crate instead of requiring compile time flags.) Or alternatively, disable Unicode with `--no-pcre2-unicode` and no transcoding will be done. :-)
- dagenix 8y agoI installed with: PCRE2_SYS_STATIC=1 RUSTFLAGS="-C target-cpu=native" rustup run nightly cargo install ripgrep --force --features 'simd-accel avx-accel pcre2' `--no-pcre2-unicode` sped it up a little. But, it was already quite fast. Great work on ripgrep and thanks for such an amazing tool!