Skip to content

Commit baad4ea

Browse files
authored
chore: add summary to benchmark output (#12097)
* chore: add summary to benchmark output * chore: add summary to benchmark output
1 parent 97e5b52 commit baad4ea

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

benchmarking/run.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ const benchmarks = [
2525
];
2626

2727
async function run_benchmarks() {
28+
let total_time = 0;
29+
let total_gc_time = 0;
2830
// eslint-disable-next-line no-console
2931
console.log('-- Benchmarking Started --');
3032
$.push({}, true);
3133
try {
3234
for (const benchmark of benchmarks) {
35+
const results = await benchmark();
3336
// eslint-disable-next-line no-console
34-
console.log(await benchmark());
37+
console.log(results);
38+
total_time += Number(results.time);
39+
total_gc_time += Number(results.gc_time);
3540
}
3641
} catch (e) {
3742
// eslint-disable-next-line no-console
@@ -42,7 +47,12 @@ async function run_benchmarks() {
4247
}
4348
$.pop();
4449
// eslint-disable-next-line no-console
45-
console.log('-- Benchmarking Complete --');
50+
console.log(`-- Benchmarking Complete --`);
51+
// eslint-disable-next-line no-console
52+
console.log({
53+
total_time: total_time.toFixed(2),
54+
total_gc_time: total_gc_time.toFixed(2)
55+
});
4656
}
4757

4858
run_benchmarks();

0 commit comments

Comments
 (0)