I ran these two on a mid sized repo (4k lines of rust).
rg ranges from 0.015 to 0.025 while ag ranges from 0.009 to 0.014 total cpu time.
I didn’t run very comprehensive benchmarks though :P
Would you believe it if I said that never did I once benchmark any of the tools on very small repositories such as that? I’d say you’re comfortably well within “startup time matters” size.
Of course, that isn’t to say it isn’t important. There’s no technical reason why we shouldn’t be just as fast on ag in this case. I created an issue for it. Thanks!
I find it to be just a tiny bit slower than ag, comparing
time rg "fn .*(.*)"andtime ag "fn .*(.*)"Is there anyway I can reproduce it? Is it on data that we can both access? What platform?
What happens if you pass
--mmaptorg? (I wonder if there’s more to the memory map story than I’ve let on in my blog.)I ran these two on a mid sized repo (4k lines of rust). rg ranges from 0.015 to 0.025 while ag ranges from 0.009 to 0.014 total cpu time. I didn’t run very comprehensive benchmarks though :P
Would you believe it if I said that never did I once benchmark any of the tools on very small repositories such as that? I’d say you’re comfortably well within “startup time matters” size.
Of course, that isn’t to say it isn’t important. There’s no technical reason why we shouldn’t be just as fast on
agin this case. I created an issue for it. Thanks!I just ran them against the dragonflybsd codebase (25k files, 8 million lines), and rg won.
time rg “fn .(.)”:
0.79s user 0.33s system 203% cpu 0.548 totaltime ag “fn .(.)”:
1.79s user 0.57s system 140% cpu 1.676 total