From 2617f84a83a7cf2301ac5787bda77a3aceffa63a Mon Sep 17 00:00:00 2001 From: KhooLy <73142442+KhooLy@users.noreply.github.com> Date: Tue, 28 Jul 2026 23:12:33 +0300 Subject: [PATCH] chore(desktop): remove per-call performance debug logging dispatchAction/completeEffect/coreInvoke logged bytes/timing/domains for every single IPC round-trip, spamming the debug log with hundreds of lines for one screen load. Removed entirely. --- src/core/engine.ts | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/core/engine.ts b/src/core/engine.ts index 210d766..36fcfd2 100644 --- a/src/core/engine.ts +++ b/src/core/engine.ts @@ -5,23 +5,6 @@ import type { CoreMethod } from "./coreMethods"; let engineHandle: number | null = null; -function debugLog(msg: string) { - void invoke("debug_log", { msg }).catch(() => {}); -} - -function logDispatch(label: string, raw: string | null, ms: number) { - if (!raw) return; - let domains: string[] = []; - try { - domains = Object.keys((JSON.parse(raw) as DispatchResult).state ?? {}); - } catch {} - debugLog( - `${label} bytes=${raw.length} ms=${ms.toFixed(1)} domains=[${ - domains.join(",") - }]`, - ); -} - export async function initEngine(initialJson: string = "{}"): Promise { if (engineHandle !== null) return; engineHandle = await invoke("engine_init", { initialJson }); @@ -37,9 +20,7 @@ export async function dispatchAction( }`; } catch {} return Sentry.startSpan({ name: label, op: "fluxa.ipc" }, async () => { - const t0 = performance.now(); const raw = await invoke("engine_dispatch", { actionJson }); - logDispatch(label, raw, performance.now() - t0); if (!raw) return null; return JSON.parse(raw) as DispatchResult; }); @@ -52,15 +33,9 @@ export async function completeEffect( name: `completeEffect:${result.effectId}`, op: "fluxa.ipc", }, async () => { - const t0 = performance.now(); const raw = await invoke("engine_complete_effect", { resultJson: JSON.stringify(result), }); - logDispatch( - `completeEffect:${result.effectId}`, - raw, - performance.now() - t0, - ); if (!raw) return null; return JSON.parse(raw) as DispatchResult; }); @@ -132,13 +107,7 @@ export async function coreInvoke( return Sentry.startSpan( { name: `coreInvoke:${method}`, op: "fluxa.core" }, async () => { - const t0 = performance.now(); const raw = await invoke("core_invoke", { method, argsJson }); - debugLog( - `coreInvoke:${method} bytes=${argsJson.length}+${raw.length} ms=${ - (performance.now() - t0).toFixed(1) - }`, - ); const envelope = JSON.parse(raw) as { ok: boolean; value?: T;