Experiment: deb2eb9
rad experiment show deb2eb93dd6fac3a07c58afedd82a9d6ff8ff5fe
by lftherioslftherios@did:key:z6MkupQHdQky5atyAu9zF8dUu1EavUjckDgCdZLH8y2W8teE · May 11 09:43 2026
Tried a custom PreviewView that rendered rows directly into the buffer to avoid preview Vec/Line allocation, but it was slightly slower than the current best.
Measurements
MetricBaselineThe benchmark measurement of the unmodified codeCandidateThe code with the proposed optimization appliedCandidate/Parent ΔThe performance change from baseline to candidate
render_ms (ms) primary
Optimize the `rustik-tui` headless render benchmark in `crates/tui/benches/render.rs`.
2289.000 ms (n=1)2301.000 ms (n=1)+0.52% REGRESSED
fps secondary873.600 (n=1)869.400 (n=1)-0.48% REGRESSED
mcells_per_s secondary268.400 (n=1)267.100 (n=1)-0.48% REGRESSED
Annotations
best_before2289
candidate2301
changed_files
[
  "crates/tui/benches/render.rs"
]
hypothesisDirect preview rendering might remove the remaining allocation overhead from the 18-row preview pane.
lessonFor the already-trimmed preview pane, direct manual rendering is not an obvious win.
next_action_hintIf revisiting the preview path, only do it with a cleaner zero-allocation design that also avoids formatting the row number each frame; otherwise focus elsewhere.
rollback_reasonThe custom widget measured 2301ms versus the 2289ms incumbent while adding noticeably more bespoke rendering logic.
Base CommitThe starting commit before the optimization was appliedfe2678d3da4f52f2bd2563dd060c61e11730ade4
Candidate CommitThe code with the proposed optimization appliedno new code recorded — metadata only
Bench script697817fe958a
bench_cmdbash autoresearch.sh
Schemav5
Environment
Archaarch64
OSDarwin 26.3.1
CPUApple M1 Max
Agentpi-autoresearch / pi
Files—