|
|
|
|
|
by anooh
1718 days ago
|
|
Wow this is amazing. It's super fast and has a very easy to follow help page, plus the formatting is pretty awesome. I just did a quick benchmark searching for `kthreadd` using grep and ag and it's magnitudes faster than grep. Thank you for sharing this. I hope I can convince the network admins at my workplace to install this tool. In addition, A+ for the ag's design for `mmap()` ing files instead reading them into a buffer. Bench marks:
Using Grep ```bash
$ time grep -Rsn "kthreadd"
...
real 0m25.341s
user 0m5.738s
sys 0m4.074s
``` Using ag:
```bash
$ time ag "kthreadd"
... real 0m2.182s
user 0m1.306s
sys 0m1.773s
``` |
|
I'd be careful with that. You may have just tested the awesomeness of linux caches :-)
Yes, it "looks" magnitudes faster:
But wait, somehow grep got magnitutes faster too: And we can make both ag and rg slower: