forked from 1b-agent/opencadstudio-upstream
perf: report a skipped partition without printing zero counts
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 <[email protected]>
This commit is contained in:
1 parent
5eb762e88d
commit
eef007d080
1 file changed
+21
-9
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user