perf: make edit history incremental

Replace full-document snapshots with Arc first-touch deltas and batch cache invalidation. Reuse interaction and GPU category caches across unrelated edits.
This commit is contained in:
Hakan Seven committed 2026-07-24 23:25:33 +03:00
1 parent 90714d34b2
commit ea93e169ea
19 files changed
+979 -339

No files matched your search

+5 -5
View File
@@ -78,15 +78,15 @@ impl OpenCADStudio {
if self.oops_cache.is_empty() {
self.command_line.push_info("OOPS: nothing to restore.");
} else {
self.push_undo_snapshot(i, "OOPS");
let restored = std::mem::take(&mut self.oops_cache);
let pending = self.begin_undo(i, "OOPS", restored.len(), true);
let restored = self.tabs[i].scene.restore_erased_entities(restored);
let n = restored.len();
for e in restored {
self.tabs[i].scene.add_entity_clone(e);
}
self.tabs[i].scene.bump_geometry();
self.tabs[i].dirty = true;
self.refresh_properties();
if let Some(pending) = pending {
self.commit_undo_delta(i, pending);
}
self.command_line
.push_output(&format!("OOPS: restored {n} object(s)."));
}