Repository navigation
Commit 36fbd12
committed
perf(tui): async file loading, LRU rendering cache, and bounded variant caps for full-file view
Fixes #833: Decouple synchronous file reading and Chroma highlighting
from View() render loop into an async cache keyed by target path, size,
modtime and diff fingerprint.
- Bound total source bytes consumed with io.LimitReader and immediate
cutoff on oversized physical lines (> fileViewMaxBytes).
- Bound rendered ANSI variants per cache entry with a 4-slot LRU to prevent
memory growth across window resizes or changed line mutations.
- Bound memory with 4000 lines / 1 MiB total / 4 KiB line limits and
evict cleanly on theme changes.1 parent 27b319c commit 36fbd12
4 files changed
Lines changed: 663 additions & 59 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
| |||
0 commit comments