HomeFreeBSD

pfctl: cache getprotobynumber results

Description

pfctl: cache getprotobynumber results

As for example pfctl -ss keeps calling it, it saves a lot of overhead
from elided parsing of /etc/nsswitch.conf and /etc/protocols.

Sample result when running a pre-nvlist binary with nfs root and dumping
7 mln states:
before: 24.817u 62.993s 1:28.52 99.1%
after: 8.064u 1.117s 0:18.87 48.5%

Idea by Jim Thompson

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 858937bea4599d254a97ee6321683f8629604e15)

Details

Provenance
mjgAuthored on Jul 1 2021, 7:25 PM
Parents
rG3f136d9fea86: pf: revert: Use counter(9) for pf_state byte/packet tracking
Branches
Unknown
Tags
Unknown