bridge: Optimize iface_lookup() and port_lookup_iface() with a hash.
authorBen Pfaff <blp@nicira.com>
Wed, 5 May 2010 21:00:47 +0000 (14:00 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 5 May 2010 21:00:47 +0000 (14:00 -0700)
commit4a1ee6ae821f73c877af1548d6db9a0e04ad8eaf
tree7abbcece449cf251f50fe3cf153520eaf5fbdb49
parent9e15c889f7a94db2decefd93dd6b3f77fb1b7bc6
bridge: Optimize iface_lookup() and port_lookup_iface() with a hash.

Before this commit and the following one, with 1000 interfaces strcmp()
took 36% and port_lookup() took 8% of total runtime when reconfiguring
bridges.  With these two commits the percentage is reduced to 3% and 0%,
respectively.
lib/shash.c
lib/shash.h
vswitchd/bridge.c