Commit 97480b84 authored by Vincent Pelletier's avatar Vincent Pelletier

CMFCategory: Do not use __getitem__ to access a subobject.

It is extremely slow for some reason on large BTreeFolders inside
BTreeFolder2's has_key (even on warm caches). Using get instead is
significantly faster.
Found by chance, calling getAcquiredCategoryList on a random Person when
person_module contains of the order of magnitude of a million documents.
parent 6aed2a71
......@@ -943,10 +943,7 @@ class CategoryTool(BaseTool):
return self._filterCategoryListByPermission(base_category, base, result, checked_permission)
# First we look at local ids
for object_id in base_category_value.getAcquisitionObjectIdList():
my_acquisition_object = context[object_id]
except (KeyError, AttributeError):
my_acquisition_object = None
my_acquisition_object = context.get(object_id)
if my_acquisition_object is not None:
#my_acquisition_object_path = my_acquisition_object.getPhysicalPath()
#if my_acquisition_object_path in acquired_object_dict:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment