HeadlinesBriefing favicon HeadlinesBriefing.com

Ripgrep Outperforms Grep and Ag in Speed Benchmarks

Hacker News •
×

A new command line search tool called ripgrep claims to combine the usability of The Silver Searcher with the raw performance of GNU grep. Written in Rust, ripgrep is available for Linux, Mac, and Windows, and promises to be faster than existing tools like ag, git grep, and pt while maintaining Unicode support.

In a comprehensive benchmark comparison, the author tested 25 different scenarios comparing ripgrep against popular search tools. The results showed that for both single-file and large-directory searches, no other tool consistently outperformed ripgrep in either speed or correctness. The benchmarks also revealed that tools using memory maps for multi-file searches are generally slower, not faster, contrary to common assumptions.

Beyond raw speed, ripgrep offers features like recursive directory search, .gitignore support, file type filtering, and colorized output. It includes full Unicode support without the performance penalty seen in other tools. The author, who has worked on text search in Rust for 2.5 years, provides detailed insights into the performance characteristics of each tool, explaining the technical reasons behind the results.