mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-18 12:27:37 +00:00
Cut with direct-selected anchors or segments removed each object selected whole, and each path it left with no segment, with its own remove. Every removal shifted the siblings after it, so later lookups walked the document's tree again. With 2,000 roots removed whole, the old loop walked the tree 10,005 times. These removals now go through the same batch that already places the surviving pieces, which rebuilds the children of each layer or group once, and compound paths left with no members are removed after it. A compound path left with one member stays a compound path. The document, the selection, the clipboard and the undo step are the same as before. With 2,000 of 10,000 squares on one layer selected whole and two anchors of another picked, Cut walks the tree 8 times instead of 10,005 and takes a median of 11 ms of CPU time instead of 573 ms (release build on Linux, seven alternating runs in one process).