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

1 Comments

Brock Author Profile Page said:

Works great as far as I can tell!

Leave a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About this Entry

This page contains a single entry by Andy Lester published on December 6, 2007 9:16 PM.

Chart::Math::Axis figures tick intervals was the previous entry in this blog.

Find::Lib simplifies loading of libraries is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Technorati Profile