From 21606dc43e15d4bcb9d3d40ab5f6036ac8d82ab4 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Tue, 25 Aug 2026 18:37:12 +0500 Subject: [PATCH] editor: disable the profiler by default --- apps/web/src/components/editor/profiling.ts | 9 ++++----- packages/editor/src/utils/__tests__/profiler.test.ts | 10 +++++----- packages/editor/src/utils/profiler.ts | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/apps/web/src/components/editor/profiling.ts b/apps/web/src/components/editor/profiling.ts index c4fc0d88d..277808939 100644 --- a/apps/web/src/components/editor/profiling.ts +++ b/apps/web/src/components/editor/profiling.ts @@ -197,10 +197,9 @@ export function installProfilerGlobals() { }; (globalThis as unknown as Record).editorProfiler = api; - console.log( - profiler.enabled - ? "[profiler] on by default. window.editorProfiler.print() for a report, .disable() to turn off." - : "[profiler] off. window.editorProfiler.enable() to turn it back on." - ); + if (profiler.enabled) + console.log( + "[profiler] active. window.editorProfiler.print() for a report, .disable() to turn off." + ); return api; } diff --git a/packages/editor/src/utils/__tests__/profiler.test.ts b/packages/editor/src/utils/__tests__/profiler.test.ts index 3637c852d..45a1b04e5 100644 --- a/packages/editor/src/utils/__tests__/profiler.test.ts +++ b/packages/editor/src/utils/__tests__/profiler.test.ts @@ -29,15 +29,15 @@ beforeEach(() => { }); describe("profiler", () => { - test("is enabled by default", () => { + test("is disabled by default", () => { globalThis.localStorage?.clear(); - expect(new Profiler().enabled).toBe(true); + expect(new Profiler().enabled).toBe(false); }); - test("stays disabled across reloads once turned off", () => { + test("stays enabled across reloads once turned on", () => { globalThis.localStorage?.clear(); - new Profiler().disable(); - expect(new Profiler().enabled).toBe(false); + new Profiler().enable(); + expect(new Profiler().enabled).toBe(true); }); test("records nothing while disabled", () => { diff --git a/packages/editor/src/utils/profiler.ts b/packages/editor/src/utils/profiler.ts index 17b83bedc..6b476afa5 100644 --- a/packages/editor/src/utils/profiler.ts +++ b/packages/editor/src/utils/profiler.ts @@ -18,7 +18,7 @@ along with this program. If not, see . */ const STORAGE_KEY = "nn:profiler"; -const DEFAULT_ENABLED = true; +const DEFAULT_ENABLED = false; const DEFAULT_MAX_SAMPLES = 4000; const DEFAULT_MAX_TIMELINE = 4000;