From f785ecee1a68faac517a6d35763dd26ef033d722 Mon Sep 17 00:00:00 2001 From: evan Date: Wed, 20 Apr 2022 22:06:39 +0300 Subject: feat(bench): update API, new console reporter (#14305) This commit changes "deno bench" subcommand, by updating the "Deno.bench" API as follows: - remove "Deno.BenchDefinition.n" - remove "Deno.BenchDefintion.warmup" - add "Deno.BenchDefinition.group" - add "Deno.BenchDefintion.baseline" This is done because bench cases are no longer run fixed amount of iterations, but instead they are run until there is difference between subsequent runs that is statistically insiginificant. Additionally, console reporter was rewritten completely, to looks similar to "hyperfine" reporter. --- cli/tests/testdata/bench/only.out | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cli/tests/testdata/bench/only.out') diff --git a/cli/tests/testdata/bench/only.out b/cli/tests/testdata/bench/only.out index 3c9855560..b874c9a96 100644 --- a/cli/tests/testdata/bench/only.out +++ b/cli/tests/testdata/bench/only.out @@ -1,7 +1,9 @@ Check [WILDCARD]/bench/only.ts -running 1 bench from [WILDCARD]/bench/only.ts -bench only ... 1000 iterations [WILDCARD] ns/iter ([WILDCARD]..[WILDCARD] ns/iter) ok ([WILDCARD]) - -bench result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out ([WILDCARD]) +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) +[WILDCARD]/bench/only.ts +benchmark time (avg) (min … max) p75 p99 p995 +------------------------------------------------- ----------------------------- +only [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] error: Bench failed because the "only" option was used -- cgit v1.2.3