Skip to content

Perf (investigate): search zero-width regex iteration; per-row git branch subprocess #53

Description

@Legacynnn

Audit finding from the improve skill (2026-06-11, commit 2818226c). Investigate-first — profile before fixing (bun run dev:analyze enables the perf HUD).

Two low-priority perf investigations

  1. Zero-width regex matches in workspace content searchsrc-tauri/src/workspace/files/search.rs:244-251: when a match has zero width, the loop advances one char boundary at a time; a pathological user regex (^, lookarounds) on long lines could iterate excessively per line. Consider a per-line iteration cap. Effort S.
  2. One git branch --show-current subprocess per sidebar workspace rowsrc-tauri/src/workspace/helpers.rs:82-84 carries the author's own note: TODO(perf): one git branch --show-current subprocess per row; cache by repo path with watcher invalidation if it shows up in profiles. Honor the TODO's condition: profile first; if it shows up, batch/cache by repo path with git-watcher invalidation. Effort M.

Both are LOW impact until profiling says otherwise — this issue exists so they aren't re-discovered by the next audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    improveadvisor-generated planperf

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions