Skip to content
  • Mateusz Guzik's avatar
    pfctl: cache getprotobynumber results · 858937be
    Mateusz Guzik authored
    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")
    858937be