Skip to main content
Commonmark migration
Source Link

From [Why GNU grep is fast][1] Why GNU grep is fast :

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!

and then

From [Why GNU grep is fast][1] :

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!

and then

From Why GNU grep is fast :

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!

and then

  • Don't look for newlines in the input until after you've found a match.
Source Link
SylvainD
  • 1.8k
  • 1
  • 11
  • 27

From [Why GNU grep is fast][1] :

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!

and then