diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-24 14:09:45 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-24 20:59:59 -0300 |
| commit | 93d901ec5b80c36cb6c9d9027a8b39de5adafaca (patch) | |
| tree | bedeef40bec64693f819d975880ea219854212ad /src/tty/tty.zig | |
| parent | c07af484b6f2688a64e850562d1f804c76c5ac52 (diff) | |
| download | pardes-93d901ec5b80c36cb6c9d9027a8b39de5adafaca.tar.gz pardes-93d901ec5b80c36cb6c9d9027a8b39de5adafaca.zip | |
anim 1b: the probe measures input-to-present latency, where each frame's work goes (zones: body rows and colours, the GUI's build, shaping, rasterizing, a soft present's GPU wait, upload and flip) and the view presented; timedemos for throughput (stress), every file kind of a corpus (kinds) and every kind of pane (panes)
Diffstat (limited to 'src/tty/tty.zig')
| -rw-r--r-- | src/tty/tty.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig index 572a6f2a..efe8c752 100644 --- a/src/tty/tty.zig +++ b/src/tty/tty.zig @@ -1619,6 +1619,13 @@ const Shell = struct { const core = s.core; const tz_event = tracy.zone(@src(), "event"); defer tz_event.end(); + // A key's or a click's time, for its latency to the frame that + // answers it (FrameStats): when the loop takes it in. + switch (event) { + .key_press => core.frames.input(pardes.FrameStats.nowNs()), + .mouse => |m| if (m.type == .press) core.frames.input(pardes.FrameStats.nowNs()), + else => {}, + } switch (event) { .nop => {}, .wake => if (s.test_clock) |*virtual| { @@ -1877,6 +1884,9 @@ const Shell = struct { const tz_render = tracy.zone(@src(), "vx.render"); const before = s.tty.tty_writer.pos + s.tty.writer().end; vx.render(s.tty.writer()) catch {}; + // The frame's cost to the terminal (FrameStats.Frame.bytes): what + // vaxis's diff of the cells wrote. + s.core.frames.bytes +|= @intCast(@min(std.math.maxInt(u32), s.tty.tty_writer.pos + s.tty.writer().end -| before)); if (s.tty.tty_writer.pos + s.tty.writer().end != before) FrameAck.ask(s.tty.writer(), @intCast(std.Io.Clock.awake.now(s.io).nanoseconds)); tz_render.end(); } |
