perf(logviewer): 512 KB tail instead of 1 MB

1 MB (~6500 lines) fetched, split and re-rendered every second made the window
lag. 512 KB (~3200 lines) keeps a useful backlog — double the original 256 KB —
while staying responsive.
This commit is contained in:
2026-08-04 23:58:38 +02:00
parent 98f11ee3d0
commit ef087492cc
2 changed files with 7 additions and 6 deletions
+5 -4
View File
@@ -21,12 +21,13 @@ import { TailLogFile, GetLogFilePath } from '../../wailsjs/go/main/App';
// 256 KB blob: with "cluster" or "acom" typed in, the window becomes exactly
// the subsystem trace you would have grepped for.
// • It polls only while open. A closed dialog costs nothing.
// 1 MB ≈ 6500 lines. The window is a sliding tail: once new lines push past it
// 512 KB ≈ 3200 lines. The window is a sliding tail: once new lines push past it
// the oldest fall out of the fetched text entirely, so a small buffer dropped
// lines the operator was still reading during a busy trace (CAT/cluster/antenna
// polling). The backend caps this at 4 MB; 1 MB is a good balance against the
// per-poll payload while open.
const TAIL_BYTES = 1024 * 1024;
// polling). This is double the old 256 KB — 1 MB was tried but the per-second
// fetch + split + re-render of ~6500 lines made the window lag. 512 KB keeps a
// useful backlog while staying smooth. The backend caps this at 4 MB.
const TAIL_BYTES = 512 * 1024;
const POLL_MS = 1000;
export function LogViewer({ open, onOpenChange }: { open: boolean; onOpenChange: (v: boolean) => void }) {