Performance Benchmarks
ripgrep is the fastest tool in every test below, but the margin ranges from about 1.3× to 36× depending on the tool and the pattern.
All numbers come from the ripgrep README. ripgrep.dev did not re-run them. Results vary by hardware, pattern, and corpus.
Linux Kernel Source Tree
Searches the Linux kernel source tree (after make defconfig && make -j8) for [A-Z]+_SUSPEND, where all matches must be words. Each tool applies its own default filtering, so they do not all search the same files and their line counts differ.
| Tool | Lines | Time | vs ripgrep |
|---|---|---|---|
| ripgrep (Unicode) fastest | 536 | 0.082s | — |
| hypergrep | 536 | 0.167s | 2.04× |
| git grep | 536 | 0.273s | 3.34× |
| The Silver Searcher | 534 | 0.443s | 5.43× |
| ugrep | 536 | 0.639s | 7.82× |
| git grep | 536 | 0.727s | 8.91× |
| git grep (Unicode) | 536 | 2.670s | 32.70× |
| ack | 2,677 | 2.935s | 35.94× |
Lower is better.
Linux Kernel, Equivalent Work
The same corpus and pattern, but ignoring gitignore files and searching a whitelist of .c and .h files instead, so every tool does equivalent work.
| Tool | Lines | Time | vs ripgrep |
|---|---|---|---|
| ripgrep fastest | 447 | 0.063s | — |
| ugrep | 447 | 0.607s | 9.62× |
| GNU grep | 447 | 0.674s | 10.69× |
Lower is better.
Single Large File (~13 GB)
Searches a single ~13 GB file (OpenSubtitles, decompressed) cached in memory. Adding -n for line numbers raises the times to 1.664s for ripgrep and 9.484s for GNU grep. ugrep is unaffected.
| Tool | Lines | Time | vs ripgrep |
|---|---|---|---|
| ripgrep (Unicode) fastest | 7,882 | 1.042s | — |
| ugrep | 7,882 | 1.339s | 1.28× |
| GNU grep (Unicode) | 7,882 | 6.577s | 6.31× |
Lower is better.
Performance Cliffs
A small change to the pattern can change the result a lot. On the same file, ugrep goes from 1.28× to 27.51× slower than ripgrep.
| Tool | Lines | Time | vs ripgrep |
|---|---|---|---|
| ripgrep (Unicode) fastest | 485 | 1.053s | — |
| GNU grep (Unicode) | 485 | 6.234s | 5.92× |
| ugrep | 485 | 28.973s | 27.51× |
Lower is better.
Patterns With No Literals
Performance drops across the board on big files when a pattern offers no opportunities for literal optimizations. Locale matters a lot here for GNU grep.
| Tool | Lines | Time | vs ripgrep |
|---|---|---|---|
| ripgrep fastest | 6,749 | 15.569s | — |
| ugrep | 6,749 | 21.857s | 1.40× |
| GNU grep | 6,749 | 32.409s | 2.08× |
| GNU grep (Unicode) | 6,795 | 8m30s | 32.74× |
Lower is better.
High Match Counts
Many matches slow every tool down and shrink the gaps between them, because the time goes mostly to handling matches rather than finding them.
| Tool | Lines | Time | vs ripgrep |
|---|---|---|---|
| ripgrep fastest | 83,499,915 | 6.948s | — |
| ugrep | 83,499,915 | 11.721s | 1.69× |
| GNU grep | 83,499,915 | 15.217s | 2.19× |
Lower is better.
About These Numbers
Test Setup
- CPU: Intel i9-12900K 5.2 GHz
- Kernel corpus: Linux kernel source tree, after
make defconfig && make -j8 - Large file: ~13 GB OpenSubtitles, decompressed and cached in memory
Keep in Mind
- The README's author warns that a single benchmark is never enough.
- These tests come from ripgrep's own author, not an independent lab.
- The README doesn't list other system details, such as RAM or OS.
Why is ripgrep so fast?
See it yourself
Download ripgrep and run it on your own codebase.