From 45ea3c55f8bc02f0914b2f41573f6a1d975b9e63 Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Thu, 10 Oct 2024 04:31:34 -0700 Subject: [PATCH] dont log plugin message queue when plugin processing takes too long Summary: While profiling the bloks debugger i noticed that in the heap snapshot the largest strings were these log messages. this is because we log the entire message queue which can be enormous. this creates a negative feedback loop in that the giant string adds additional memory pressure. Reviewed By: passy Differential Revision: D64105989 fbshipit-source-id: 495913ae886196825a1c949b6b3980f56c241cee --- desktop/flipper-ui/src/utils/pluginStats.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/flipper-ui/src/utils/pluginStats.tsx b/desktop/flipper-ui/src/utils/pluginStats.tsx index b0439415b09..d843c32aa8e 100644 --- a/desktop/flipper-ui/src/utils/pluginStats.tsx +++ b/desktop/flipper-ui/src/utils/pluginStats.tsx @@ -126,8 +126,8 @@ export function addBackgroundStat( stat.maxTime = Math.max(stat.maxTime, cpuTime); if (cpuTime > MAX_BACKGROUND_TASK_TIME) { console.warn( - `Plugin ${plugin} took too much time while doing background: ${cpuTime}ms. Handling background messages should take less than ${MAX_BACKGROUND_TASK_TIME}ms.`, - messages, + `Plugin ${plugin} took too much time while doing background: ${cpuTime}ms. Handling background messages should take less than ${MAX_BACKGROUND_TASK_TIME}ms. message queue length`, + messages.length, ); } }