Page MenuHome

[WIP] Windowmanager: improve duplicate check of notifiers.
AbandonedPublic

Authored by Monique Dewanchand (mdewanchand) on Aug 17 2022, 4:13 PM.

Details

Summary

When adding many objects(10.000+) via python at once, the notifier queue
becomes very large. Measured with hotspot, this duplication check takes a
huge amount of time.

This (draft) prototype adds a hashmap for looking up duplicates. Using this
hashmap i.o. the listbase for duplication check speedups the performance greatly.

This patch is a draft, meant to discuss the solution of using a different, more
robust datatype, for duplication check. I didn't take implementing the notifier queue
as a different, more robust data type into account as this might make the impact greater.
But I might imagine this can be a possibility as well i.o. introducing another variable for reading
(2 variables to keep in sync ).
Also this patch misses implementation of deleting/removing notifications and adding events.

Diff Detail

Repository
rB Blender
Branch
wm_notifier_perfomance (branched from master)
Build Status
Buildable 23369
Build 23369: arc lint + arc unit

Event Timeline

Monique Dewanchand (mdewanchand) requested review of this revision.Aug 17 2022, 4:13 PM
Monique Dewanchand (mdewanchand) created this revision.
Monique Dewanchand (mdewanchand) retitled this revision from Windowmanager: improve duplicate check of notifiers. to [WIP] Windowmanager: improve duplicate check of notifiers..Aug 17 2022, 4:17 PM
Monique Dewanchand (mdewanchand) edited the summary of this revision. (Show Details)

Thanks for the patch. There are already a few implementations of this change though: D15129 and the pastes from Campbell in that patch.

Thank you @Hans Goudey (HooglyBoogly). Didn't know this was already being worked on. I guess I can withdraw this patch.
BTW, do you know if there is also work being done on improving the performance of the BKE_layer_collection_sync?

In chat I mentioned that T73411 probably corresponds to the BKE_layer_collection_sync performance improvements.