Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ripgrep (rg) instead of grep where available #348

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rameshsanth
Copy link

Ripgrep is orders of magnitude faster than grep especially on big files.

Here is a sample from my workspace. My tags file for entire project hovers around 16G

du -sh tags
7.3G tags

time rg --text -ve ^[^?]+?my_project_foo.cpp? tags > tgs.tmp1
real 48.223 user 7.852 sys 38.735 pcpu 96.60

time grep --text -Ev ^[^?]+?my_project_foo.cpp? tags > tgs.tmp
real 106.256 user 13.446 sys 88.974 pcpu 96.39

@ludovicchabant
Copy link
Owner

That seems like a good idea! Could you adjust the change so that we store grep or rg inside a ${GREP} variable, and then use that for the command line? This way the command line isn't duplicated. Thanks!

@rameshsanth rameshsanth requested a review from MaxGyver83 August 26, 2023 16:14
@MaxGyver83
Copy link

@ludovicchabant : I just stumbled over this tab in my browser which must have been open since two months :-)
I had commented on this PR and after the last change it looks good to me. I have approved it (symbolically).
Can this be merged? I have applied this code locally and didn't notice anything not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants