Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have seen those and those were what I was implicitly referring to. And if you did read them,"- Don't look for newlines in the input until after you've found a match." is just one of them but not the major contributor for speed. It's Boyer-Moore.


Hm, there seems to be written like so there:

> 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!

(italics added, but uppercase original!) On my reading this sounds quite huge; I seem to understand the gist is that it's still a significant gain after Boyer-Moore. But, whatever.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: