forked from 1b-agent/opencadstudio-upstream
Three cuts to the per-edit cost, on top of the incremental wire arena: - Enable OCS_WIRE_GPU_PATCH by default (kill-switch OCS_WIRE_GPU_PATCH=0), so the in-place / append-tombstone arena — validated on the reference drawing (wire block ~300ms + 265MB upload -> ~2ms) — is on for everyone; a bail always falls back to the identical batched path. - Resident patch: an all-Modified edit never reorders, so reassemble by walking the recorded assembled order (~10k handles) instead of scanning the whole document (~800k) to re-derive draw order. Add/Remove still scan (positions change). ~14ms -> <1ms on a move. - SDF text: a new content id misses the glyph cache every edit, but if no text-bearing entity (Text/MText/Dimension/MLeader/Leader/Table/attribute/INSERT) changed since the last build the glyphs are identical, so reuse them. ~23ms -> 0 on a plain-geometry edit. A move/edit on this 800k-entity drawing now spends ~50ms (dominated by the undo document clone) instead of ~85ms, and the wire GPU upload is gone. Co-Authored-By: Claude Opus 4.8 <[email protected]>