vim-gutentags icon indicating copy to clipboard operation
vim-gutentags copied to clipboard

Use ripgrep (rg) instead of grep where available

Open rameshsanth opened this issue 1 year ago • 2 comments

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

rameshsanth avatar Apr 21 '23 05:04 rameshsanth

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!

ludovicchabant avatar Aug 15 '23 15:08 ludovicchabant

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

MaxGyver83 avatar Oct 29 '23 18:10 MaxGyver83