Skip to content

perf: validate secondary formatting, chart and frame-scratch hotspots #420

Description

@subinium

Priority: P2
Evidence: Investigation; costs identified in source, aggregate impact unmeasured
Baseline: v0.23.0 source 37933f9, audited 2026-09-05. Native execution/compile probes used Rust 1.98.0 on aarch64 macOS unless explicitly stated otherwise.

Problem and Reproduction

Potential costs include histogram full sorting for min/max/counting, repeated Sequence duration sums, selection cells scanning the content map, owned WASM events copied through frame's slice API, and newly allocated named-focus/consumed scratch. These are not established top bottlenecks.

src/chart/bar.rs:67 · src/anim.rs:561 · src/terminal/selection.rs:119 · crates/slt-wasm/src/lib.rs:990 · src/context/runtime.rs:243

Scope

  • Measure each candidate separately and only land independently justified changes.
  • Compare one-pass min/max, immutable duration caching, interval-based selection lookup, frame_owned and scratch reuse.
  • For ANSI integer formatting, prefer MSRV-compatible buffer writes before considering newer standard-library APIs.

Expected Effect

Capture low-risk savings after larger correctness and scaling issues, without speculative refactoring or an unnecessary MSRV bump.

Acceptance Criteria

  • Provide per-candidate release timings/allocation deltas and output/interaction parity tests.
  • Public mutation, event ordering/consumption and selection boundaries remain correct.
  • Do not aggregate unrelated changes into one unreviewable implementation commit.
  • Record rejected candidates as measured no-change decisions.
  • Follow the repository quality gates and the evidence rules in tracking: post-v0.23 correctness, resource efficiency and WASM completion #366; record actual results rather than treating a proposed test as passed.

Boundaries and Dependencies

Local1.98.0 was the audit baseline; patched stable should be used for future validation. New1.98 formatting APIs are optional tradeoffs, not a requirement to raise MSRV1.88.

Related closed work: #81, #269. This is a scoped follow-up at the audit baseline, not a claim that every prior fix is absent.

Tracking: #366. This issue records unresolved work, not an implemented fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:libsrc/lib.rs entry pointsenhancementNew feature or requestseverity:warningPerf or code smell; should fixtype:perfPerformance: allocations, syscalls, ms reduction

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions