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
- Don't look for newlines in the input until after you've found a match. [1]: http://lists.freebsd.org/pipermail/freebsd-current/2010-August/019310.html