Aims to fix the slowness of #3801 which happens on all platforms.
There are two layers of problems behind this:
- Slow indexed operations of SPObject->children and DrawingItem. They are currently organized in linked lists, so indexed operations and reordering takes linear time. This is fixed by the "Introducing OrderedList" commit, which makes indexed operations and reordering take logarithmic time.
- GTK3 signaling chaos triggered by entry changes in ObjectsPanel. Ungrouping brings each group member adjacent to its parent's siblings, and each reorder takes linear time. This is fixed by rebuilding the entire pane from scratch after ungrouping operation finishes so that it takes linear time overall, available on the commit "Rebuild objects pane after ungrouping". This fix is GTK3-specific for Inkscape 1.4.x and might not be relevant once ObjectsPanel gets ported to GTK4 in 1.5.
Progress so far:
- Ungrouping original sample file can finish in ~1 minute instead of forever
Still triggered numerous selectionChanged signals that runs asynchronously but indefinitely after ungrouping, so UI is slowly responsive and CPU usage is 100% on a single core.- As we have ~35000 items on the object pane, every time selection changes it triggers GTK row validation which in turn validates the values on all the 16x35000 cells. This consistently takes 1-2 minutes on my machine, and I think it's another problem to be fixed in another PR.
TODO:
- Show screen recording
- Show flame graphs
[?] Rebuild the objects pane with the final selection states instead of relying on selection changed signals
Edited by Nagata Aptana
























