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.

(cherry picked from commit df546c3b730d4abcace1da24226bd5f01280588e)

Details

Provenance
kevansAuthored on Dec 9 2020, 5:27 AM
Parents
rG7bb960ce6447: MFC kern: cpuset: properly rebase when attaching to a jail
Branches
Unknown
Tags
Unknown