freebsd-nq/sbin/pfctl
Mateusz Guzik 858937bea4 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")
2021-07-01 21:31:45 +00:00
..
tests
Makefile
Makefile.depend
parse.y
pf_print_state.c
pf_ruleset.c
pf.os
pfctl_altq.c
pfctl_ioctl.h
pfctl_optimize.c
pfctl_osfp.c
pfctl_parser.c
pfctl_parser.h
pfctl_qstats.c
pfctl_radix.c
pfctl_table.c
pfctl.8
pfctl.c
pfctl.h