From eef007d08038b84b48117952cf4a39ad9b80d67f Mon Sep 17 00:00:00 2001 From: Panos <25664832+mechpanos@users.noreply.github.com> Date: Tue, 8 Sep 2026 15:37:09 +0300 Subject: [PATCH] perf: report a skipped partition without printing zero counts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The skip branch printed `circles=0 ellipses=0`, which reads as "there are no circles" when it means "not recomputed this frame" — and those counts were the evidence that confirmed the skip works, so the wording nearly cost a misreading of it. The skip now prints its own line with what it retained. Measured effect of the skip itself, on the reproducer: a drawn point goes from 98 ms to 17-39 ms, `prepare` from 89 ms to 11-23 ms. Frames that draw a circle still re-partition, and the instance counts show it — 40868, 40869 … 40874, one per circle, with the line frames skipped in between. Co-Authored-By: Claude Opus 5 --- src/scene/view/render.rs | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/scene/view/render.rs b/src/scene/view/render.rs index cb01fac4d..8dced63d5 100644 --- a/src/scene/view/render.rs +++ b/src/scene/view/render.rs @@ -910,15 +910,27 @@ impl shader::Primitive for Primitive { .map_or(0.0, |t| t.elapsed().as_secs_f64() * 1000.0); } if _perf { - crate::perf_record!( - "[perf] arena-post partition={part_ms:.1}ms blocks={blk_ms:.1}ms \ -curves={curve_ms:.1}ms skipped={} wires={} instanced={} circles={} ellipses={}", - partitioned.is_none(), - vp_wires.len(), - partitioned.as_ref().map_or(0, |p| p.instanced.len()), - partitioned.as_ref().map_or(0, |p| p.circle_instances.len()), - partitioned.as_ref().map_or(0, |p| p.ellipse_instances.len()), - ); + // Counts only when a partition produced them. + // Printing zeros on a skip reads as "no circles" + // rather than "not recomputed", which is the + // opposite of what the line is reporting. + match &partitioned { + Some(partitioned) => crate::perf_record!( + "[perf] arena-post partition={part_ms:.1}ms \ +blocks={blk_ms:.1}ms curves={curve_ms:.1}ms skipped=false wires={} instanced={} \ +circles={} ellipses={}", + vp_wires.len(), + partitioned.instanced.len(), + partitioned.circle_instances.len(), + partitioned.ellipse_instances.len(), + ), + None => crate::perf_record!( + "[perf] arena-post skipped=true wires={} \ +retained_contributors={}", + vp_wires.len(), + inner.partition_contributors.len(), + ), + } } if _patched { wire_arena::patch_handle_index(