bug 9877; fix performace with people tree view and some filters
When using deep relationship filters on the person tree view with a large tree, the tree redraw can take a long time (hours). The DeepRelationshipPathBetween 'prepare' method was getting called for every person in the preceding filter. And that it also ran through every person in the db within the prepare method. Resulting in time as a square function of number of people. Change view code so that 'prepare' method is called once, and 'apply' method is called once with list of handles to scan, rather than both called once per handle.
This commit is contained in:
parent
0c03ec2fc1
commit
52846b8e68
@ -591,16 +591,20 @@ class TreeBaseModel(GObject.GObject, Gtk.TreeModel, BaseModel):
|
||||
pmon.add_op(status_ppl)
|
||||
|
||||
self.__total += items
|
||||
|
||||
with gen_cursor() as cursor:
|
||||
for handle, data in cursor:
|
||||
if not isinstance(handle, str):
|
||||
handle = handle.decode('utf-8')
|
||||
status_ppl.heartbeat()
|
||||
if not handle in skip:
|
||||
if not dfilter or dfilter.match(handle, self.db):
|
||||
assert not skip
|
||||
if dfilter:
|
||||
for handle in dfilter.apply(self.db,
|
||||
cb_progress=status_ppl.heartbeat):
|
||||
data = data_map(handle)
|
||||
add_func(handle, data)
|
||||
self.__displayed += 1
|
||||
else:
|
||||
with gen_cursor() as cursor:
|
||||
for handle, data in cursor:
|
||||
status_ppl.heartbeat()
|
||||
add_func(handle, data)
|
||||
self.__displayed += 1
|
||||
|
||||
status_ppl.end()
|
||||
status.end()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user