From 03bf1ac021dce53ba23932510ed68b89afaa958d Mon Sep 17 00:00:00 2001 From: Cong-Cong Date: Wed, 20 Nov 2024 11:12:46 +0800 Subject: [PATCH 1/2] feat: rss-memory metric --- lib/compare.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compare.js b/lib/compare.js index 204df3a1..fa2e2be5 100644 --- a/lib/compare.js +++ b/lib/compare.js @@ -76,7 +76,7 @@ async function getResults(date, index, benchmarkDirectory) { } export async function compare(base, current, benchmarkDirectory) { - const compareMetric = ["exec"]; + const compareMetric = ["exec", "rss memory"]; const index = await fetchIndex(); if (base === "latest") { From 706233a49b64b1708357c450f93337ad441d050d Mon Sep 17 00:00:00 2001 From: Cong-Cong Date: Wed, 20 Nov 2024 11:48:24 +0800 Subject: [PATCH 2/2] fix: ignore memory stastics in hmr stage --- lib/compare.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/compare.js b/lib/compare.js index fa2e2be5..0aa51b51 100644 --- a/lib/compare.js +++ b/lib/compare.js @@ -20,7 +20,12 @@ function getOverThresholdTags(diff) { if (typeof data.baseMean !== 'number') { return null; } - if (data.currentMean / data.baseMean < 1.05) { + if (tag.endsWith("memory")) { + if (data.currentMean / data.baseMean < 1.3) { + // The memory usage is unstable (with fluctuations of approximately 20%) during Hot Module Replacement (HMR), so it won't be counted for now. + return null; + } + } else if (data.currentMean / data.baseMean < 1.05) { return null; } return tag;