Repository navigation
perf 1/5: benchmark harness, TOASTTY_STATS counters and baseline - #61
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 1/5 of the performance programme. It adds the measurement tooling the rest of the stack is judged by, and records a baseline. The PRs above this one each fix one area, and each one's body shows its own before/after.
What's here
TOASTTY_STATS=<path>(crates/toastty/src/perf_stats.rs). When it's set, the binary counts frames, skipped frames and PTY bytes/events, and times parsing andrender_term. It also records output→frame and key→frame latency, utime/stime and VmHWM/VmRSS, and writes all of it as JSON when the PTY closes. When it's unset, every hook is a branch onNone.bench/run.py. 13 scenarios on a private Xvfb display, with seeded workloads cached in--work/data: startup, idle CPU (blinking and steady),catfloods (ASCII, SGR colour, Unicode/CJK/emoji,seq), vtebench-styledense_cellsat 128×42 and 256×73, scrollback memory, key latency, and wheel-scroll frame time at two window sizes. It follows the AGENTS.md safety rules: an explicit free display ≥ 99, throwaway config,HISTFILE=/dev/null, and it only kills PIDs it started.bench/compare.py. Turns result files into a Markdown before/after table.examples/parse_bench.rs. Headless parser +Termthroughput, with no window or GPU.pprofcargo feature (off by default) andbench/profile.sh/bench/folded.py. An in-process SIGPROF sampler for machines whereperf/samplyaren't allowed (perf_event_paranoid=2).bench/README.md. How to use all of the above.Baseline (
maind29928d, Ryzen 7 3700X + RX 7700 XT, Xvfb +MESA_VK_WSI_DEBUG=sw, median of 3)cat64 MB ASCIIcat32 MB SGRcat16 MB Unicodeseq3M linesseq20 MB/sWhat the baseline shows:
RedrawRequesteduntil the flood is over, and the backlog sits in memory meanwhile.The rest of the stack addresses both.
Visual evidence
There's no visual change. This is the instrumented build with
TOASTTY_STATSset, drawing colour, CJK, emoji and a combining mark as usual:Tests
cargo test -p toastty: 302 passed. Clippy adds no warnings in the new files (--features pprof).