Submission + - Why GNU Grep Is Fast As Comapre To BSD Version
An anonymous reader writes: There is some flamage currently going on regarding BSD grep vs GNU grep performance. Mike Haertel, the original author of GNU grep added some interesting information regarding its performance — "#1 trick: GNU grep is fast because it AVOIDS LOOKING AT EVERY INPUT BYTE. #2 trick: GNU grep is fast because it EXECUTES VERY FEW INSTRUCTIONS FOR EACH BYTE that it *does* look at. Moreover, GNU grep AVOIDS BREAKING THE INPUT INTO LINES. Looking for newlines would slow grep down by a factor of several times, because to find the newlines it would have to look at every byte!