diff --git a/.husky/pre-commit b/.husky/pre-commit index ea5a55b6f..2312dc587 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -bunx lint-staged +npx lint-staged diff --git a/src/utils/startupProfiler.ts b/src/utils/startupProfiler.ts index d16b094a8..2e8f9f2b4 100644 --- a/src/utils/startupProfiler.ts +++ b/src/utils/startupProfiler.ts @@ -142,6 +142,13 @@ export function profileReport(): void { logForDebugging('Startup profiling report:') logForDebugging(getReport()) } + + // Clear startup marks to prevent PerformanceMark accumulation in long-lived + // processes (daemon, cron). After this point startup marks are no longer needed + // — the report has been written and the Statsig event has been logged. + const perf = getPerformance() + perf.clearMarks() + memorySnapshots.length = 0 } export function isDetailedProfilingEnabled(): boolean {