2 ms·
It can't avoid breaking the output into lines, though, so it probably looks for newlines after a match is found. I assume the Boyer Moore preprocessor reads a
by tyingq 8y ago
It can't avoid breaking the output into lines, though, so it probably looks for newlines after a match is found.
I assume the Boyer Moore preprocessor reads a lot of bytes also.
Not disputing it's more efficient, but there's no magic. It avoids reading some bytes when and if it can.
- dllthomas 8y ago> It can't avoid breaking the output into lines It can whenever you don't ask for line numbers, can't it? > It probably looks for newlines after a match is found Probably, yeah. Counting number of newlines in a range, without caring just where they fall, can probably be pretty darned fast with vector instructions. Idk if that's worth the additional pass, though.