Skip to content

perf: measure and reduce textarea document-wide work and paste scaling #415

Description

@subinium

Priority: P2
Evidence: Source-supported performance investigation; no release speedup measured
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

Each frame clones the line vector and builds a visual map; accepted paste repeatedly counts/indexes the growing line per grapheme. Undo retains bounded-count full-document snapshots. #95's no-second-wrap-on-unchanged-frame branch is present; the remaining costs are not the old double-wrap claim.

src/context/widgets_input/textarea_progress.rs:68 · src/context/widgets_input/textarea_progress.rs:317 · src/widgets/input.rs:1077

Scope

  • Benchmark idle/edit/end-vs-middle paste on1KB/100KB/1MB ASCII/CJK/ZWJ documents.
  • Consider bulk insert, versioned/lazy visual indexing and byte-aware/delta history only where justified.
  • Preserve externally mutable text state, cursor/grapheme behavior and response.changed semantics.

Expected Effect

Reduce latency and memory copies for large editors while retaining exact editing and undo behavior.

Acceptance Criteria

  • Publish release before/after p50/p95, allocations/bytes and history retained memory.
  • No-op or net-zero batches do not spuriously report changes or evict history.
  • Public line mutations and wrap-width changes invalidate caches correctly.
  • Retain rejection/partial paste undo and mixed-event ordering regressions.
  • 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

Do not substitute a naive dirty flag that changes net-result or public-mutation semantics, or mandate rope/arena adoption without evidence.

Related closed work: #94, #95, #91. 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:widgets-inputInput widgets (text input, textarea)enhancementNew 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