From e6c03a8ae07d912bbd7fb717378db7cdb27836a6 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 8 Sep 2024 23:13:11 +0800 Subject: [PATCH] Run benchmark independent of the component lifecycle --- src/app.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app.jsx b/src/app.jsx index a6563c13..f17699d9 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -306,6 +306,8 @@ window.__BENCH_RESULTS = new Map(); window.__BENCHMARK = { start(name) { if (!import.meta.env.DEV && !import.meta.env.PHANPY_DEV) return; + // If already started, ignore + if (BENCHES.has(name)) return; const start = performance.now(); BENCHES.set(name, start); },