CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2026/06/23 09:34:00
Modified files:
usr.sbin/bgpd : chash.c
Log message:
Use ffs and slots &= slots - 1 to walk over the slots in a way to only
look at matches. Kills another branch in the hot path and reduces the
loop form 7 to the number of hits (which is close to 1).
On systems without native ffs instruction this can be a tiny bit slower
but modern systems have native ffs and there the speedup can be noticable.
Even systems without ffs benefit on lookup misses since the loop is skipped.
Based on a diff from Rango (kombucha at mm.st)
OK tb@