From 5e1482da714a58e834945237458d5fbd4421c569 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 19 Mar 2024 05:47:04 -0400 Subject: [PATCH] Improve getReport performance (#21) Uses backwards-compatible feature of Node.js 22+ --- lib/process.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/process.js b/lib/process.js index d27fcb7..ee78ad2 100644 --- a/lib/process.js +++ b/lib/process.js @@ -9,9 +9,14 @@ let report = null; const getReport = () => { if (!report) { /* istanbul ignore next */ - report = isLinux() && process.report - ? process.report.getReport() - : {}; + if (isLinux() && process.report) { + const orig = process.report.excludeNetwork; + process.report.excludeNetwork = true; + report = process.report.getReport(); + process.report.excludeNetwork = orig; + } else { + report = {}; + } } return report; };