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);
|
.map_or(0.0, |t| t.elapsed().as_secs_f64() * 1000.0);
|
||||||
}
|
}
|
||||||
if _perf {
|
if _perf {
|
||||||
crate::perf_record!(
|
// Counts only when a partition produced them.
|
||||||
"[perf] arena-post partition={part_ms:.1}ms blocks={blk_ms:.1}ms \
|
// Printing zeros on a skip reads as "no circles"
|
||||||
curves={curve_ms:.1}ms skipped={} wires={} instanced={} circles={} ellipses={}",
|
// rather than "not recomputed", which is the
|
||||||
partitioned.is_none(),
|
// opposite of what the line is reporting.
|
||||||
vp_wires.len(),
|
match &partitioned {
|
||||||
partitioned.as_ref().map_or(0, |p| p.instanced.len()),
|
Some(partitioned) => crate::perf_record!(
|
||||||
partitioned.as_ref().map_or(0, |p| p.circle_instances.len()),
|
"[perf] arena-post partition={part_ms:.1}ms \
|
||||||
partitioned.as_ref().map_or(0, |p| p.ellipse_instances.len()),
|
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 {
|
if _patched {
|
||||||
wire_arena::patch_handle_index(
|
wire_arena::patch_handle_index(
|
||||||
|
|||||||
Reference in new issue
Block a user