mirror of
https://github.com/excalidraw/excalidraw.git
synced 2026-09-28 01:33:02 +08:00
perf(element): reuse one moved-element ID set when dragging dragSelectedElements passed a fresh Array.from(elementsToUpdate) to every element's updateBoundElements call. Each call missed the per-array ID-set cache and rebuilt a selection-sized set, so a drag step was quadratic in the number of dragged elements. Build the array once per drag step, pass it to every call, and reuse its cached set (getSimultaneouslyUpdatedElementIds, now exported) for the unbinding checks too. Document that callers must pass one array instance per operation and must not change its membership afterwards. Dragging 1K / 2K / 4K selected rectangles in the app went from 45 / 160 / 643 ms to 18.5 / 31 / 54 ms per frame (same tab, same window, dev build). Add coverage for the shared array, grouped labels across z-order, frames with their children, bound arrows, bindings, unbinding, and unchanged coordinates. Claude Opus 5.5 (1M context), reasoning effort 40