mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 16:39:42 +02:00
perf: optimize tab switching responsiveness
- Increase chunked write size from 64KB to 128KB (halves write time) - Start buffer fetch immediately before other setup work - Show "Loading session..." indicator during fetch - Parallelize session attach with buffer fetch - Fire-and-forget resize call (don't block on it) Reduces perceived tab switch latency by ~50-100ms for large buffers. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -310,11 +310,17 @@ for (const segment of segments) {
|
||||
```
|
||||
Note: Segments starting with `DEC_SYNC_START` are incomplete blocks awaiting more data. These are skipped (discarded if timeout forces flush).
|
||||
|
||||
**chunkedTerminalWrite(buffer, chunkSize=64KB):**
|
||||
**chunkedTerminalWrite(buffer, chunkSize=128KB):**
|
||||
- For large buffer restoration (session switch, reconnect)
|
||||
- Writes 64KB per `requestAnimationFrame` to avoid UI jank
|
||||
- Writes 128KB per `requestAnimationFrame` to avoid UI jank
|
||||
- Strips any embedded DEC 2026 markers from historical data
|
||||
|
||||
**selectSession() optimizations:**
|
||||
- Starts buffer fetch immediately before other setup
|
||||
- Shows "Loading session..." indicator while fetching
|
||||
- Parallelizes session attach with buffer fetch
|
||||
- Fire-and-forget resize (doesn't block tab switch)
|
||||
|
||||
### Optional Flicker Filter
|
||||
|
||||
Per-session toggle via Session Settings. Adds ~50ms latency but eliminates remaining flicker on problematic terminals.
|
||||
|
||||
Reference in New Issue
Block a user