ack 1.75_01 speeds up 40-70%
ack is my replacement for grep geared to large source trees. I've just released 1.75_01 (a developer release, please note) which is a big speedup for what I suspect is the most common case of scanning large directories of many relatively (<100K) small files and not finding matches in all of them.
Here's what it does: It checks the size of each file, and if it's <100K, slurps up the entire file. Then, it scans the entire 100K file at once, and if there are no matches, then there's no need to do the line-by-line more expensive searching.
In my test scanning a couple of big source directories like ~/parrot, it saved about 40% run-time. If I had -C or -B to store context, it saved about 70% run-time because the saving of context is more expensive.
So, please, check it out and make sure all is still working. Also, any eyes on the algorithm I'm using would be appreciated, too. I'm sure I can do things cleaner or a bit more speedily, but right now I'm mostly worried about accuracy.
0 TrackBacks
Listed below are links to blogs that reference this entry: ack 1.75_01 speeds up 40-70%.
TrackBack URL for this entry: http://perlbuzz.com/cgi-bin/mt/mt-tb.cgi/235
Works great as far as I can tell!