Re:Ripgrep is faster (2016)
by burntsushi on Saturday September 08, 2018 @05:32PM
(#17942891)
git grep can be fast, depending on what you're searching for and how much you need to search. If you commonly search literals, then git grep's literal optimizations probably make it good enough for you. But increasing the pattern complexity just a bit can result in large performance cliffs. For example: (times reported after running each command a few times to account for I/O cache)
Both of these invocations are doing roughly equivalent work, including
respecting gitignores. Both of them are using a Unicode aware `\w` character
class. OK, so you might say you don't care about Unicode. That's fine, ripgrep
is still faster by an order of magnitude:
With that said, `git grep` can now be made to use PCRE2, which gives it a
significant speed boost on this workload:
ripgrep can do the same as of this release, but faster:
Do these performance differences matter to you? Maybe not. But you said you
couldn't understand; hopefully the numbers above add some clarity. :-) On top
of that, ripgrep works just as well outside of git repos, on huge log files,
binary data or even in shell pipelines.
[ Parent
| on HN ]
There are no comments on this comment yet.