perf(io,scene): drop redundant purge walk, fuse world-offset scan

Phase 1.1: resolve_xrefs now purges corrupt entities inline as it
merges each xref and returns the dropped count, removing the second
full-document purge_corrupt_entities walk in the FileOpened handler.
Every xref-bearing open saves one O(N) entities() pass.

Phase 2.4: split compute_world_offset into offset_prep / offset_centroid
/ world_offset_from_centers; centroid accumulation now rides the existing
cache-handle walk in build_derived_caches. Two O(N) entity walks collapse
into one, with identical MSPACE-membership filtering preserved.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-05 00:32:39 +03:00
1 parent b466747074
commit 3098523b8d
7 files changed
+149 -120

No files matched your search

+1 -1
View File
@@ -116,7 +116,7 @@ pub fn prepare_xref_block(scene: &mut Scene, path: &str) -> String {
// Resolve the XREF content immediately.
let path_buf = std::path::PathBuf::from(path);
if let Some(base_dir) = path_buf.parent() {
crate::io::xref::resolve_xrefs(&mut scene.document, base_dir);
let _ = crate::io::xref::resolve_xrefs(&mut scene.document, base_dir);
}
block_name