HomeFreeBSD

grep: replace the internal queue with a ring buffer

Description

grep: replace the internal queue with a ring buffer

We know up front how many items we can have in the queue (-B/Bflag), so
pay the cost of those particular allocations early on.

The reduced queue maintenance overhead seemed to yield about an ~8%
improvement for my earlier grep -C8 -r closefrom . test.

MFC after: 2 weeks

Details

Provenance
kevansAuthored on Dec 9 2020, 5:27 AM
Parents
rG281412ce7bfa: grep: tests: stop expecting a failure of gnuext w/ bsdgrep
Branches
Unknown
Tags
Unknown