NOW LET US – AI RAG SaaS Studio TP.HCM
NOW LET US
Digital Product Studio
Back to news
DEV-TOOLS...2 min read

Ripgrep is faster than grep, ag, git grep, ucg, pt, sift (2016)

Share
NOW LET US Article – Ripgrep is faster than grep, ag, git grep, ucg, pt, sift (2016)

Ripgrep is a new command line search tool that combines the usability of The Silver Searcher with the raw performance of GNU grep. Written in Rust, it stands out for its superior speed, proper Unicode support, and efficient handling of large directories.

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. ripgrep 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.

Introducing ripgrep

Pitch

Why should you use ripgrep over any other search tool? Well…

  • It can replace many use cases served by other search tools because it contains most of their features and is generally faster.
  • Like other tools specialized to code search, ripgrep defaults to recursive directory search and won’t search files ignored by your .gitignore files. It also ignores hidden and binary files by default.
  • ripgrep can search specific types of files. For example, rg -tpy foo limits your search to Python files.
  • ripgrep supports many features found in grep, such as showing the context of search results, searching multiple patterns, highlighting matches with color and full Unicode support.
  • ripgrep has optional support for switching its regex engine to use PCRE2 (using the -P flag).
  • ripgrep supports searching files in text encodings other than UTF-8, such as UTF-16, latin-1, GBK, EUC-JP, Shift_JIS and more.
  • ripgrep supports searching files compressed in a common format (gzip, xz, lzma, bzip2 or lz4) with the -z/--search-zip flag.

Anti-pitch

Reasons not to use ripgrep probably consist of:

  • You need a portable and ubiquitous tool that conforms to standards like POSIX. The best tool for this is grep.
  • There exists some other feature or bug not yet addressed in ripgrep.
  • There is a performance edge case where ripgrep doesn’t do well.

Installation

The binary name for ripgrep is rg.

  • Homebrew: $ brew install ripgrep
  • Archlinux: $ pacman -Syu ripgrep
  • Rust programmer: $ cargo install ripgrep

Whirlwind tour

To recursively search the current directory, while respecting all .gitignore files, ignore hidden files and directories and skip binary files:

$ rg foobar

To ignore all ignore files, use -u. To additionally search hidden files and directories, use -uu. To additionally search binary files, use -uuu.

© 2026 Now Let Us. All rights reserved.

Source: Hacker News

Advertisement
Ad slot ready: 5887729102

More in this category

EXPLORE TOPICS

Discover All Categories

Deep dive into the specific technology sectors that matter most to you.