You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(tui): full-file view performs large synchronous reads and highlighting during render #833
Open the TUI file view for a generated file containing thousands of large lines.
Switch to full-file rendering.
Observe input/render latency and memory growth while the view synchronously reads and highlights the file.
Relevant code: internal/tui/file_view.go:164-230.
renderFileViewFull performs disk I/O, retains up to 4,000 lines, allows scanner tokens up to 16 MiB each, syntax-highlights all accepted lines, and fits every rendered line synchronously in the view path. There is a line cap but no practical total-byte cap.
Expected behavior
Rendering should remain responsive and memory-bounded even for unusually large/generated files. The View path should render cached model state rather than perform blocking disk/highlighting work.
Actual behavior
A file within the current line/token limits can trigger long synchronous work and severe allocation pressure, freezing terminal interaction.
Suggested fix and regression test
Load and highlight through a cancellable tea.Cmd, cache by path plus modification identity, and enforce both a modest total-byte cap and a smaller per-line cap.
Add tests proving repeated View calls do not reread/rehighlight, and that large lines/files are truncated within a fixed byte budget.
Reported by PierrunoYT from a full codebase audit.
Still present: renderFileViewFull is at internal/tui/file_view.go:168 and does the read, the highlighting and the fitting inside the render path.
Sorry for the wait. This one we would take, but it is behind the correctness reports you filed the same day. There is no wrong output here, only latency and memory on large files, so if you are picking one to work on first take #831 or #834. When you do get to this, the fix we want is moving the read and highlight off the render path with a total-byte cap, not just a smaller line cap.
@PierrunoYT same situation as #868: internal/tui/file_view.go still exists but renderFileViewFull does not, so the cited code has been renamed or restructured since you filed.
The underlying concern is very likely still live, since nothing suggests the view moved off synchronous reads. But I do not want to approve a performance issue against a function that no longer exists, because whoever picks it up would start from a stale map.
Could you re-point it at the current code? Happy to approve once it lands on something real.
Activity
Vasanthdev2004 commentedon Aug 5, 2026
Still present:
renderFileViewFullis atinternal/tui/file_view.go:168and does the read, the highlighting and the fitting inside the render path.Sorry for the wait. This one we would take, but it is behind the correctness reports you filed the same day. There is no wrong output here, only latency and memory on large files, so if you are picking one to work on first take #831 or #834. When you do get to this, the fix we want is moving the read and highlight off the render path with a total-byte cap, not just a smaller line cap.
Vasanthdev2004 commentedon Aug 12, 2026
@PierrunoYT same situation as #868:
internal/tui/file_view.gostill exists butrenderFileViewFulldoes not, so the cited code has been renamed or restructured since you filed.The underlying concern is very likely still live, since nothing suggests the view moved off synchronous reads. But I do not want to approve a performance issue against a function that no longer exists, because whoever picks it up would start from a stale map.
Could you re-point it at the current code? Happy to approve once it lands on something real.
perf(tui): async file loading, LRU rendering cache, and bounded varia…
perf(tui): bounded file read, LRU rendering cache, and size caps for …
perf(tui): bounded file read, LRU rendering cache, and size caps for …
perf(tui): bounded file read, LRU rendering cache, and size caps for …
perf(tui): bounded file read, LRU rendering cache, and size caps for …
perf(tui): bounded file read, LRU rendering cache, and size caps for …