Skip to content

Commit 5e1482d

Browse files
authored
Improve getReport performance (#21)
Uses backwards-compatible feature of Node.js 22+
1 parent 2642d96 commit 5e1482d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/process.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ let report = null;
99
const getReport = () => {
1010
if (!report) {
1111
/* istanbul ignore next */
12-
report = isLinux() && process.report
13-
? process.report.getReport()
14-
: {};
12+
if (isLinux() && process.report) {
13+
const orig = process.report.excludeNetwork;
14+
process.report.excludeNetwork = true;
15+
report = process.report.getReport();
16+
process.report.excludeNetwork = orig;
17+
} else {
18+
report = {};
19+
}
1520
}
1621
return report;
1722
};

0 commit comments

Comments
 (0)