Hacker News new | ask | show | jobs
by ggreer 3583 days ago
I found another pt performance issue. Searching an 8GB file:

    % time pt -i hello4294967296 big_file.txt
    big_file.txt
    134217728:hello4294967296
    
    pt -i hello4294967296 big_file.txt  535.86s user 1.35s system 100% cpu 8:56.97 total

That's right: pt takes 9 minutes to do a case-insensitive match on an 8GB file. On the same machine doing the same search, ag takes 7 seconds and grep takes 4s.

Also, it looks like pt was beating ag because it defaults to case-sensitive search. If I make ag do the same case-sensitive search, it's slightly faster in my benchmarks (0.63s to search my ~/code directory vs pt's 0.65s).