Skip to content

Commit

Permalink
Improve getReport performance (#21)
Browse files Browse the repository at this point in the history
Uses backwards-compatible feature of Node.js 22+
  • Loading branch information
styfle authored Mar 19, 2024
1 parent 2642d96 commit 5e1482d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 5e1482d

Please sign in to comment.