Skip to content

Comment on Why GNU grep is Fast

Comments

Speaking as a guy who writes in assembly too, I'm not sure that much can be gained by BM at least on modern out-of-order processors. The cost of comparing every byte is low, and to skip a few bytes can cost more in additional instructions which can slow the pipeline than it would be by just searching through every byte for the first one. Other speedups (mmap) sound reasonable.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.