From baad4ea3200d3bb926b09c87178333f0900554af Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Thu, 20 Jun 2024 09:47:35 +0100 Subject: [PATCH] chore: add summary to benchmark output (#12097) * chore: add summary to benchmark output * chore: add summary to benchmark output --- benchmarking/run.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/benchmarking/run.js b/benchmarking/run.js index 8114641be..ca1f5eb68 100644 --- a/benchmarking/run.js +++ b/benchmarking/run.js @@ -25,13 +25,18 @@ const benchmarks = [ ]; async function run_benchmarks() { + let total_time = 0; + let total_gc_time = 0; // eslint-disable-next-line no-console console.log('-- Benchmarking Started --'); $.push({}, true); try { for (const benchmark of benchmarks) { + const results = await benchmark(); // eslint-disable-next-line no-console - console.log(await benchmark()); + console.log(results); + total_time += Number(results.time); + total_gc_time += Number(results.gc_time); } } catch (e) { // eslint-disable-next-line no-console @@ -42,7 +47,12 @@ async function run_benchmarks() { } $.pop(); // eslint-disable-next-line no-console - console.log('-- Benchmarking Complete --'); + console.log(`-- Benchmarking Complete --`); + // eslint-disable-next-line no-console + console.log({ + total_time: total_time.toFixed(2), + total_gc_time: total_gc_time.toFixed(2) + }); } run_benchmarks();