Re:Make grep 50x faster
by comex on Sunday December 15, 2013 @01:17PM
(#6910221)
Note that, at least as of GNU grep 2.14, if you don't use -i, the discrepancy doesn't show up, so it's smart enough to recognize that the UTF-8 search can be correctly performed as a byte search. I suspect the insensitive version can also be done correctly much faster, though.
[ Parent
| on HN ]
> it's smart enough to recognize that the UTF-8 search can be correctly performed as a byte search
It shouldn't that simple – it'd also need to confirm that the pattern wouldn't match any combining characters or normalization would still be necessary.
The non-leading utf-8 bytes all are in an easily detected range that doesn't overlap with ascii.