Skip to content

Commit

Permalink
fix: improve performance of getReport()
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Mar 1, 2024
1 parent 8cf409b commit c528a86
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ const isLinux = () => process.platform === 'linux';
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 c528a86

Please sign in to comment.