ripgrep is faster than {grep, ag, git grep, ucg, pt, sift}
In this article I will introduce a new command line search tool, ripgrep , that combines the usability of The Silver Searcher (an ack clone) with the raw performance of GNU grep. ripgrep is fast, cross platform (with binaries available for Linux, Mac and Windows) and written in Rust.
ripgrep is available on Github.
We will attempt to do the impossible: a fair benchmark comparison between several popular code search tools. Specifically, we will dive into a series of 25 benchmarks that substantiate the following claims:
For both searching single files and huge directories of files, no other tool obviously stands above ripgrep in either performance or correctness.
in either performance or correctness. ripgrep is the only tool with proper Unicode support that doesn’t make you pay dearly for it.
is the only tool with proper Unicode support that doesn’t make you pay dearly for it. Tools that search many files at once are generally slower if they use memory maps, not faster.
As someone who has worked on text search in Rust in their free time for the last 2.5 years, and as the author of both ripgrep and the underlying regular expression engine, I will use this opportunity to provide detailed insights into the performance of each code search tool. No benchmark will go unscrutinized!
Target audience: Some familiarity with Unicode, programming and some experience with working on the command line.
... continue reading