Live data from Hacker News

Why GNU grep is fast (2010)

lists.freebsd.org

11–20 of 133 posts

Re: Why GNU grep is fast (2010)

#11
post #9
post #2

Please add [2010] to the title

The article references an article published in 1991. Does that need stating too?

If this story was just a blogspam saying "Hey look I found this article from 1991 which is still relevant" then yes, because the story would be worth nothing by itself.

But this story is actually an email (from 2010) written by the guy WHO ORIGINALLY WROTE GREP, making it a pretty damn interesting source in its own right. In that sense, the 1991 article is very much an aside.

In conclusion, no.

Re: Why GNU grep is fast (2010)

#15

In case anyone is interested in checking it out, you can download the source here: ftp://mirrors.kernel.org/gnu/grep/

You will need some gnu common libraries. I tried building it from scratch recently, as a first step for implementing an extension idea, but didn't succeed.

(If anyone is interested, I want to add more operators, like intersection or difference of regular languages.)

Re: Why GNU grep is fast (2010)

#16
By this logic you can write really fast programs in Haskell, because it avoids computing unused values (and therefore complete calltrees). (Unfortunately, the management of such calltrees -- thunks -- often has higher cost than outright computing them in the first place.)

I try hard, but I'm not smart enough to write programs that do nothing. :)

Re: Why GNU grep is fast (2010)

#18
post #12

I don't know who to attribute the quote to, but there is one the goes something along the lines of: "The fastest method to execute is an empty method."

> "The fastest method to execute is an empty method."

The fastest method to execute is an empty method that was never called.

The fastest method to execute is an empty method that was never called and never written.

The fastest method to execute is an empty method that was never called and never written and never planned.

Re: Why GNU grep is fast (2010)

#20
In other words the correct choice of algorithm and data structure can dramatically simplify a problem and the amount of code and time needed to solve it.

It also means that having tools where you can quickly apply different techniques, ahem, composable functions, that you can search for more efficient solutions with a lot less effort. That doesn't solve the smartness problem but it makes it a lot more tractable.

Post reply on HN