

Why GNU grep is fast (2010) - dnet
https://lists.freebsd.org/pipermail/freebsd-current/2010-August/019310.html

======
ColinWright
This is posted again and again, and I re-read it _every_ time.

I'm also reminded of this:

    
    
        You can't make your code run faster,
            you can only make it do less work.
    

I usually put links to previous discussions because I find value in the
comments by HN users, but I'm not going to do that this time. You can search
if you want to find previous discussions - there have been many, and some
contain some real gems.

~~~
taeric
Some times you can make it do more book keeping to work faster, though. This
is actually a good example of that.

And, then there is an amusing reality to your message. What has done more to
increase the speed of grep? Good techniques, or advances in computing speed?
That is, making your code run faster has probably increased the speed of grep
more so than making it do less. :)

------
js2
See also, The Treacherous Optimization:

[http://ridiculousfish.com/blog/posts/old-age-and-
treachery.h...](http://ridiculousfish.com/blog/posts/old-age-and-
treachery.html)

------
sctb
Most recent discussion:
[https://news.ycombinator.com/item?id=9153203](https://news.ycombinator.com/item?id=9153203)

