Inefficient logic in _filters function of quantum.api.v2.base
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Undecided
|
Zhongyue Luo |
Bug Description
The getall() of webobs MultiDict (which is request.GET) is implemented as:
https:/
def getall(self, key):
"""
Return a list of all values matching the key (may be an empty list)
"""
result = []
for k, v in self._items:
if key == k:
return result
Therefore it iterates the entire key, val pair list to find all values for a key.
So the original implementation is:
O(keys) for "set(request.GET)" + O(unique(keys) * values) for "request.
Thus the complexity is O(unique(keys) * values)
The complexity of my suggested method is O(values) for "request.
Since unique(keys) <= values, the new complexity will be O(values)
This is only the comparison till preparing values of a key for conversion.
Changed in quantum: | |
milestone: | none → grizzly-3 |
Changed in quantum: | |
status: | Fix Committed → Fix Released |
Changed in quantum: | |
milestone: | grizzly-3 → 2013.1 |
Fix proposed to branch: master /review. openstack. org/18568
Review: https:/