Files
orca/config
Neil 6fddfd04e5 perf(terminal): stop terminal search rescanning every row of a wrapped line
SearchEngine's forward scans walk every buffer row and _findInLine rewinds each
wrapped row back to the start of its line, so a single long un-newlined line
costs O(rows^2) on the renderer's main thread. The find bar re-runs that scan on
every keystroke and again 200ms after every onWriteParsed, so a pane holding one
long line freezes repeatedly rather than searching.

A wrapped row's text was already searched when the first row of its line was, so
skip it. Only sound for a plain search: wholeWord and regex can reject at one
offset and match at a later one in the same line, so both keep the old walk.

Measured, one un-newlined line at 80 cols filling the default 5000-row
scrollback, no match (real Terminal + SearchAddon, happy-dom):

  upstream                 17046 ms
  with the recursion fix   18500 ms
  with this commit             6 ms
2026-09-02 22:42:08 -07:00
..