perf: Arc-cache paper_canvas_wires() to eliminate O(N) clone on navigation
paper_canvas_wires() now returns Arc<Vec<WireModel>> backed by paper_canvas_cache (epoch-keyed). Pan/zoom frames hit the cache and return a pointer copy; only geometry changes rebuild the wire list. Completes the paper-canvas caching chain (L+M): sheet cache → projected-per-viewport cache → full canvas Arc cache. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9a1211842d
commit
52c830e477
2 changed files with 18 additions and 3 deletions
|
|
@ -100,7 +100,7 @@ impl<'a> canvas::Program<Message> for PaperCanvas<'a> {
|
|||
};
|
||||
|
||||
// ── Wires (entity lines + inactive viewport projections) ──────────────
|
||||
for wire in &self.scene.paper_canvas_wires() {
|
||||
for wire in self.scene.paper_canvas_wires().iter() {
|
||||
let [r, g, b, a] = wire.color;
|
||||
let color = Color { r, g, b, a };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue