vt: CSI parameter parsing is 10.7% of the parse thread under DOOM-fire #417
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis#417
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split from #399.
Params::push_run(crates/felis-vt/src/lib.rs), the bulk CSI-parameter arm ofParser::advance, is the second-largest self-time frame of the parse thread under DOOM-fire. Linux profile of the daemon (i5-12400F, felismainef96bb46, release with line tables,perf record -e cycles:u --call-graph lbr, 15 s of DOOM-fire at 188x93, load 5.2), share offelis-pty-parsersamples, self time:Grid::put_graphemeParams::push_runGrid::print_wide_strbuild_sinkclosure,Parser::advanceinlinedStyleTable::internGrid::csi_dispatchParser::advance_byteAbout 85% of DOOM-fire's bytes are
38;5;N/48;5;NSGRs (.agents/skills/perf-trace/references/cost-maps.md"SGR flood / DOOM-fire"), so parameter parsing runs on most of the stream.push_runalready replaced a per-byte arm (+38% on the doom floor); the next step would be decoding a parameter's digits with fewer branches per byte.Any change here is guarded by the chunk-invariance test and the
vt_parserfuzz target, and the "Accepted cost" note in cost-maps (the sparse full-screen scroll floor reads −5% with the bulk arm present) has to be re-checked.Done when
push_run's share drops by a measured amount on the doom floor bench without the scroll floor regressing, or the profile shows the decode is at its floor and the reason is recorded.