|
|
|
|
|
by burntsushi
2661 days ago
|
|
(author of ripgrep here) Well at least one reason is because ripgrep is faster. On simple literal queries they'll have comparable speed, but beyond that, `git grep` is _a lot_ slower. Here's an example on a checkout of the Linux kernel: $ time rg '\w+_PM_RESUME' | wc -l
8
real 0.127
user 0.689
sys 0.589
maxmem 19 MB
faults 0
$ time LC_ALL=C git grep -E '\w+_PM_RESUME' | wc -l
8
real 4.607
user 28.059
sys 0.442
maxmem 63 MB
faults 0
$ time LC_ALL=en_US.UTF-8 git grep -E '\w+_PM_RESUME' | wc -l
8
real 21.651
user 2:09.54
sys 0.413
maxmem 64 MB
faults 0
ripgrep supports Unicode by default, so it's actually comparable to the LC_ALL=en_US.UTF-8 variant.There are other reasons. It is nice to use a single tool for searching in all circumstances. ripgrep can fit that role. Maybe you don't know, but ripgrep respects your .gitignore file. |
|