34 comments (34 comments)4 reactions (4 reactions)0 assignees (0 assignees)TypeScript1,574 forks (1,574 forks)batch import
area/addon/searcharea/performancehelp wantedtype/bug
Repository metrics
- Stars
- 16,196 stars (16,196 stars)
- PR merge metrics
- Avg merge 2d 10h (Avg merge 2d 10h)16 merged PRs in 30d (16 merged PRs in 30d)
Description
Currently the search addon limits itself to 1000 highlights by default. Contrast this to monaco's 20000 results before it gives up highlighting. When we increase our limit to 20000 the search itself ends up blocking the renderer pretty significantly.
Here is a profile using my i7-12700KF 3.61 GHz:
test file test.txt


Note that the search is also not incremental, so all successive searches take the same amount of time even for non-regex searches. https://github.com/xtermjs/xterm.js/issues/5177
VS Code issue: https://github.com/microsoft/vscode/issues/230365
Contributor guide
- Research direction
- Investigate the search addon in xterm.js (likely in addons/search/). The issue shows that increasing the highlight limit causes renderer blocking; profile the search function to identify bottlenecks. Consider implementing incremental search to avoid re searching non regex queries (see linked issue #5177). Evaluate using a web worker to offload search computation. The test file provided can be used to reproduce the slowdown.
- Tech stack
- typescript
- Domain
- frontendperformance
- Issue type
- Performance
- Prerequisites
- Familiarity with xterm.js search addonBasic profiling skills