Production files that require no resync still takes a long time to load when "Override Auto Resync" is enabled.
File:
* https://studio.blender.org/films/sprite-fright/3a29f46b66bd34/?asset=5459 (requires "Blender Studio" access at the moment).
Load time:
* Override Auto Resync on (default): **15min 10sec**
* Override Auto Resync off: 36sec
Profiling:
{F12739213, size=full}
Findings:
* Override resync seems entirely bottlenecked by poor time complexity.
* BKE_collection_object_find is likely easy to optimize with a hash.
* BKE_library_foreach_ID_link should be possible to optimize with a map also, but not sure how hard it is to keep this map valid if the pointers are being updated as part of this.
* lib_override_linked_group_tag could run in parallel for each object ID (in the collection tag part, the second `LISTBASE_FOREACH` loop).
Worthy noting:
* WM_main_add_notifier: likely bad time complexity with many queued notifiers, must be some way to optimize
* DEG_id_tag_update: slow depsgraph tagging, likely solveable with delayed flushing instead of for every RNA edit
* ED_object_constraint_tag_update: bad time complexity for object existence check, unclear why is even needed
* BKE_pose_channel_find_name: bad time complexity in bone lookup, create pose bone hash earlier to solve overall feels like we should be able to make this way faster
Note: profiling by @brecht , findings by @brecht and @jbakker.