summaryrefslogtreecommitdiff
path: root/test/pdf_scroll_bench.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-18 11:19:19 -0300
committerGabriel Schneider <[email protected]>2026-11-18 11:31:28 -0300
commitdd4858222aa5a24fdefbb52bb3abf7a31c7e692c (patch)
tree84dca3ef96a13b90205eccaec3927f48cd03ee40 /test/pdf_scroll_bench.zig
parenta2538c49b1bb69dcd1a6f1350834e13f68c3c05d (diff)
downloadpardes-dd4858222aa5a24fdefbb52bb3abf7a31c7e692c.tar.gz
pardes-dd4858222aa5a24fdefbb52bb3abf7a31c7e692c.zip
pdf-scroll-bench: its core's clock moves a frame each frame, as a shell's loop moves it (Pardes.advance), where it stood still: the PDF's glide and fling are on that clock since the split, so a slow scroll's travel summed into one window that never closed and counted as a fling, rendering 25 bands where 4 pages were rendered; a real window session (offscreen, its clock running) renders the same with part 2's kind and this one: 2 pages over 192 notches at 120, 30 and 4 ms a notch, a fling of 48 notches a frame 3-5 (one band) here against 4-7 (1-2 bands) with part 2's; the fixed bench on part 2's tree and on this one: slow_scroll 4 rasters and 4, instructions:u 18,451-18,455M against 18,064-18,069M (-2.1%; the unfixed bench measured 18,393-18,403M against 19,209-19,211M); the glide's frames in flight differ by decision P8 (their visual hashes); no suite compiles the bench
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/pdf_scroll_bench.zig')
-rw-r--r--test/pdf_scroll_bench.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/pdf_scroll_bench.zig b/test/pdf_scroll_bench.zig
index bb4640f7..595037ae 100644
--- a/test/pdf_scroll_bench.zig
+++ b/test/pdf_scroll_bench.zig
@@ -277,9 +277,15 @@ fn measure(config: Config, plan: Plan) !Result {
var visual: u64 = 0x7061_7264_6573_5343;
var shown: u64 = 0;
var total: u64 = 0;
+ // The core's clock a frame on at each, as a shell's loop moves it
+ // (its glide and a fling are on that clock).
+ var now: u64 = std.time.ns_per_s;
+ core.advance(now);
for (0..plan.frames) |frame| {
const button: pardes.Mouse.Button = if (plan.scenario == .fling_reverse and frame >= plan.down_frames) .wheel_up else .wheel_down;
const started = nowNs();
+ now += pardes.frame_ns;
+ core.advance(now);
for (0..ticks) |_| core.update(.{ .mouse = .{ .button = button, .kind = .press, .col = rect.x + rect.w / 2, .row = rect.y + rect.h / 2, .amount = config.turn } });
_ = arena.reset(.retain_capacity);
const surface = try core.render(arena.allocator());