Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How does it compare in speed to 'ag' (i.e the silver searcher) -g option?


I haven't benchmarked them, but fd has a recursive parallel directory iterator. ag doesn't.

The mysql-server repository[1] should be a fun one to try out, because of this:

    $ wc -l .gitignore
    3122 .gitignore
The combination of fast glob matching[2] and parallel traversal should be a boon.

[1] - https://github.com/mysql/mysql-server

[2] - https://github.com/BurntSushi/ripgrep/blob/e7c06b92fb996adcb...


fd is about a factor of 2-3 faster (for this example):

    > time fd -HIe jpg > /dev/null                     
    5,12s user 2,03s system 785% cpu 0,911 total
    
    > time ag --depth 100 -uuu -g '\.jpg$' > /dev/null
    0,95s user 1,66s system 99% cpu 2,628 total


I didn't even know that existed, thank you. ripgrep seems to have something similar:

rg -g '*.foo' --files


rg (ripgrep -- the rust-made grep/ag style tool) is already quite faster than ag.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: