mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-16 04:22:36 +00:00
chore(tui): /clean recent perf work — KISS/DRY pass
24 files, -319 LoC. Behaviour preserved, 369/369 tests green. - hermes-ink caches: shared lruEvict helper for the four parallel LRU caches (stringWidth, wrapText, sliceAnsi, lineWidth); touch-on-read stays inlined per cache; tightened output.ts skip-slice fast path. - wheelAccel: trimmed provenance header, collapsed env parsing, ternary dispatch in computeWheelStep. - perfPane: folded ensureLogDir into once-flag, spread-with-overrides for fastPath/phases instead of full rebuilds. - env: extracted truthy() (used 4×). - virtualHeights: collapsed user/diff/slash height bumps; trail+todos estimate. - useInputHandlers: scrollIdleTimer cleanup on unmount, ?? undefined shorthand. - useMainApp: dropped dead liveTailVisible IIFE and liveProgress indirection. - appLayout, markdown, messageLine, entry: vertical rhythm, dropped narration comments, inlined one-shot vars. - fix: empty catch blocks → /* best-effort */ for no-empty lint.
This commit is contained in:
parent
527ac351b4
commit
b1c49d5e73
32 changed files with 259 additions and 547 deletions
|
|
@ -979,15 +979,13 @@ export default class Ink {
|
|||
}
|
||||
|
||||
const tWrite = performance.now()
|
||||
|
||||
// Capture any stale pending write BEFORE starting this frame's write —
|
||||
// if the callback already fired, pendingWriteStart is null and lastDrainMs
|
||||
// already reflects the previous frame's drain. If it hasn't fired, we
|
||||
// report "still pending" via a non-zero duration based on now-then so
|
||||
// backpressure shows up even if Node never flushes this session.
|
||||
const staleDrain =
|
||||
this.pendingWriteStart !== null
|
||||
? performance.now() - this.pendingWriteStart
|
||||
: this.lastDrainMs
|
||||
const staleDrain = this.pendingWriteStart !== null ? performance.now() - this.pendingWriteStart : this.lastDrainMs
|
||||
|
||||
const prevFrameDrainMs = Math.round(staleDrain * 100) / 100
|
||||
this.lastDrainMs = 0
|
||||
|
|
@ -1016,6 +1014,7 @@ export default class Ink {
|
|||
}
|
||||
: undefined
|
||||
)
|
||||
|
||||
const writeMs = performance.now() - tWrite
|
||||
|
||||
// Update blit safety for the NEXT frame. The frame just rendered
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue