]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Improve performance of _get_security_group_member_ips
authorEugene Nikanorov <enikanorov@mirantis.com>
Mon, 9 Mar 2015 09:04:34 +0000 (12:04 +0300)
committerEugene Nikanorov <enikanorov@mirantis.com>
Tue, 10 Mar 2015 07:55:05 +0000 (10:55 +0300)
commit2db7182570f8217ba63d230f8f644b597ed417e9
tree5fc2a39d5df1cb7d05b06192326a97d73a9455d4
parentebc1469a7e3489ad028ed36fca07883fba889401
Improve performance of _get_security_group_member_ips

Use set operations instead of using list.
Currently complexity of the method is O(n^2) where n is
amount of ips (amount of VMs in the network).
When amount of VM is big (large L2 domain), this method
can significantly load the controller.
Reduce method complexity to O(n) on average.

Change-Id: If1660e8227e5c5cd80d49ebcc6a2e06d33d31939
Closes-Bug: #1429753
neutron/api/rpc/handlers/securitygroups_rpc.py
neutron/db/securitygroups_rpc_base.py
neutron/tests/unit/test_security_groups_rpc.py