From 1831a632364df890d1f0f0c63bcbe1adec3b73a1 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Fri, 26 Jun 2026 09:31:59 +0300 Subject: [PATCH] perf(hatch): drop the boundary outline wire from the render set (#131) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A HATCH was emitting its boundary as a dense outline polyline in the wire set on top of its fill. On hatch-heavy drawings that outline was the dominant wire-instance cost — 14.9M of 19.1M segments on the #131 sample — and on integrated GPUs (shared system RAM) the per-segment instances pushed memory past the OOM threshold on open. Skip the outline in `tessellate`: hatches render as a fill, are highlighted by their fill tint when selected (#71), and are still picked by their fill area via the existing `click_hit_hatch` path, so nothing else depends on it. Wire segments drop ~78% on the sample. Co-Authored-By: Claude Opus 4.8 --- src/scene/convert/tessellate.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scene/convert/tessellate.rs b/src/scene/convert/tessellate.rs index b990304d5..24ef44997 100644 --- a/src/scene/convert/tessellate.rs +++ b/src/scene/convert/tessellate.rs @@ -116,6 +116,16 @@ pub fn tessellate( } }; + // A HATCH is drawn as a fill by the hatch pipeline and highlighted via a + // fill tint when selected (issue #71), so it carries no boundary outline in + // the wire set. Skipping it here drops the dense boundary polyline — the + // dominant wire-instance cost on hatch-heavy drawings (issue #131). Picking + // is unaffected: hatches are caught by their fill area through the existing + // `pick::hit_test::click_hit_hatch` path, not this outline. + if matches!(entity, EntityType::Hatch(_)) { + return vec![]; + } + // MultiLeader is handled by scene/mod.rs since it emits multiple WireModels // (leader, text, frame, fill) with distinct colors. if let EntityType::Leader(leader) = entity {