ludovicchabant / vim-gutentags

A Vim plugin that manages your tag files
https://bolt80.com/gutentags/
MIT License
2.3k stars 175 forks source link

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

Open rameshsanth opened 1 year ago

rameshsanth commented 1 year ago

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 commented 1 year ago

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!

MaxGyver83 commented 11 months ago

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