|
|
|
|
|
by coldtea
3583 days ago
|
|
It's also faster (30% to 50% for my codebase), written in Go, and easier to extend. $ time ag zmq | wc -l
63
real 0m0.017s
user 0m0.022s
sys 0m0.016s
$ time pt zmq | wc -l
296
real 0m0.013s
user 0m0.014s
sys 0m0.017s
(Timing differences consistent over multiple runs of both on the same codebase -- no disc cache effect) -- the wc difference is because of different "surrounding context" setting. |
|
Another issue is that pt tends to bail on errors. If you tell it to follow symlinks (-f) and it encounters a single broken symlink, it will exit without finishing the search. Every other search tool I know of (grep, ag, ack) will keep on truckin'.
That said, pt is faster than ag for case-sensitive matches. It looks like much of that comes from a parallelized directory traversal. The architecture of ag is different. It has many worker threads, but only one thread going through dirs. Looks like I'll have to step-up my game. :)