ofproto-dpif: Improve RSPAN translation performance from O(n**2) to O(n).
authorBen Pfaff <blp@nicira.com>
Wed, 5 Oct 2011 23:33:57 +0000 (16:33 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 17 Nov 2011 18:11:53 +0000 (10:11 -0800)
commit9ba15e2a491ccb0f2c1e9f0660d041135a3afc7d
treeec7e531a4084ab14d1f1d2e45fd8cc035758750e
parentcb77e39b04904c8e8ae34d5bd6dd99c852018d52
ofproto-dpif: Improve RSPAN translation performance from O(n**2) to O(n).

This code previously checked whether each individual mirror output was
already in the set of destinations.  This is O(n**2) in the number of
ports in a bridge.

The new code uses a smarter algorithm to eliminate duplicates, one that is
O(n) in the number of ports in a bridge.
ofproto/ofproto-dpif.c