mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(bench): added group banner to bench output. (#21551)
Added group banner to bench output. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
4c2c053afe
commit
9ede8d7b69
14 changed files with 38 additions and 13 deletions
|
@ -80,7 +80,7 @@ itest!(only {
|
|||
});
|
||||
|
||||
itest!(multifile_summary {
|
||||
args: "bench bench/group_baseline.ts bench/pass.ts bench/group_baseline.ts",
|
||||
args: "bench bench/group_baseline.ts bench/pass.ts bench/multiple_group.ts",
|
||||
exit_code: 0,
|
||||
output: "bench/multifile_summary.out",
|
||||
});
|
||||
|
|
|
@ -3,3 +3,4 @@
|
|||
[WILDCARD]/bench/check_local_by_default.ts
|
||||
benchmark time (avg) iter/s (min … max) p75 p99 p995
|
||||
--------------------------------------------------------------- -----------------------------
|
||||
|
||||
|
|
1
cli/tests/testdata/bench/collect.out
vendored
1
cli/tests/testdata/bench/collect.out
vendored
|
@ -15,3 +15,4 @@ benchmark time (avg) iter/s (min … max) p75
|
|||
[WILDCARD]/bench/collect/include/bench.ts
|
||||
benchmark time (avg) iter/s (min … max) p75 p99 p995
|
||||
--------------------------------------------------------------- -----------------------------
|
||||
|
||||
|
|
1
cli/tests/testdata/bench/collect2.out
vendored
1
cli/tests/testdata/bench/collect2.out
vendored
|
@ -10,3 +10,4 @@ benchmark time (avg) iter/s (min … max) p75
|
|||
[WILDCARD]/bench/collect/include/bench.ts
|
||||
benchmark time (avg) iter/s (min … max) p75 p99 p995
|
||||
--------------------------------------------------------------- -----------------------------
|
||||
|
||||
|
|
|
@ -7,3 +7,4 @@ benchmark time (avg) iter/s (min … max)
|
|||
noop with start and end [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
Warning: start() and end() calls in "noop with start and end" are ignored because it averages less
|
||||
than 10µs per iteration. Remove them for better results.
|
||||
|
||||
|
|
2
cli/tests/testdata/bench/group_baseline.out
vendored
2
cli/tests/testdata/bench/group_baseline.out
vendored
|
@ -8,6 +8,7 @@ summary
|
|||
noo[WILDCARD]
|
||||
[WILDCARD]x [WILDCARD] than noo[WILDCARD]
|
||||
|
||||
group url
|
||||
noop3 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
parse url 2x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
parse url 200x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
|
@ -16,3 +17,4 @@ summary
|
|||
parse url 2x
|
||||
[WILDCARD]x slower than noop3
|
||||
[WILDCARD]x faster than parse url 200x
|
||||
|
||||
|
|
1
cli/tests/testdata/bench/ignore.out
vendored
1
cli/tests/testdata/bench/ignore.out
vendored
|
@ -5,3 +5,4 @@ runtime: deno [WILDCARD] ([WILDCARD])
|
|||
[WILDCARD]/bench/ignore.ts
|
||||
benchmark time (avg) iter/s (min … max) p75 p99 p995
|
||||
--------------------------------------------------------------- -----------------------------
|
||||
|
||||
|
|
|
@ -5,3 +5,4 @@ runtime: deno [WILDCARD] ([WILDCARD])
|
|||
[WILDCARD]/bench/ignore_permissions.ts
|
||||
benchmark time (avg) iter/s (min … max) p75 p99 p995
|
||||
--------------------------------------------------------------- -----------------------------
|
||||
|
||||
|
|
1
cli/tests/testdata/bench/interval.out
vendored
1
cli/tests/testdata/bench/interval.out
vendored
|
@ -5,3 +5,4 @@ runtime: deno [WILDCARD] ([WILDCARD])
|
|||
[WILDCARD]/bench/interval.ts
|
||||
benchmark time (avg) iter/s (min … max) p75 p99 p995
|
||||
--------------------------------------------------------------- -----------------------------
|
||||
|
||||
|
|
1
cli/tests/testdata/bench/meta.out
vendored
1
cli/tests/testdata/bench/meta.out
vendored
|
@ -7,3 +7,4 @@ runtime: deno [WILDCARD] ([WILDCARD])
|
|||
[WILDCARD]/bench/meta.ts
|
||||
benchmark time (avg) iter/s (min … max) p75 p99 p995
|
||||
--------------------------------------------------------------- -----------------------------
|
||||
|
||||
|
|
11
cli/tests/testdata/bench/multifile_summary.out
vendored
11
cli/tests/testdata/bench/multifile_summary.out
vendored
|
@ -1,6 +1,6 @@
|
|||
Check [WILDCARD]/bench/group_baseline.ts
|
||||
Check [WILDCARD]/bench/pass.ts
|
||||
Check [WILDCARD]/bench/group_baseline.ts
|
||||
Check [WILDCARD]/bench/multiple_group.ts
|
||||
cpu: [WILDCARD]
|
||||
runtime: deno [WILDCARD] ([WILDCARD])
|
||||
|
||||
|
@ -14,6 +14,7 @@ summary
|
|||
noo[WILDCARD]
|
||||
[WILDCARD]x [WILDCARD] than noo[WILDCARD]
|
||||
|
||||
group url
|
||||
noop3 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
parse url 2x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
parse url 200x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
|
@ -23,6 +24,7 @@ summary
|
|||
[WILDCARD]x slower than noop3
|
||||
[WILDCARD]x faster than parse url 200x
|
||||
|
||||
|
||||
[WILDCARD]/bench/pass.ts
|
||||
benchmark time (avg) iter/s (min … max) p75 p99 p995
|
||||
--------------------------------------------------------------- -----------------------------
|
||||
|
@ -37,9 +39,12 @@ bench7 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD
|
|||
bench8 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
bench9 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
|
||||
[WILDCARD]/bench/group_baseline.ts
|
||||
|
||||
[WILDCARD]/bench/multiple_group.ts
|
||||
benchmark time (avg) iter/s (min … max) p75 p99 p995
|
||||
-------------------------------------------------------------------- -----------------------------
|
||||
|
||||
group noop
|
||||
noop [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
noop2 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
|
||||
|
@ -47,6 +52,7 @@ summary
|
|||
noo[WILDCARD]
|
||||
[WILDCARD]x [WILDCARD] than noo[WILDCARD]
|
||||
|
||||
group url
|
||||
noop3 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
parse url 2x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
parse url 200x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD]
|
||||
|
@ -55,3 +61,4 @@ summary
|
|||
parse url 2x
|
||||
[WILDCARD]x slower than noop3
|
||||
[WILDCARD]x faster than parse url 200x
|
||||
|
||||
|
|
15
cli/tests/testdata/bench/multiple_group.ts
vendored
Normal file
15
cli/tests/testdata/bench/multiple_group.ts
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
Deno.bench("noop", { group: "noop" }, () => {});
|
||||
Deno.bench("noop2", { group: "noop", baseline: true }, () => {});
|
||||
|
||||
Deno.bench("noop3", { group: "url" }, () => {});
|
||||
|
||||
Deno.bench("parse url 2x", { group: "url", baseline: true }, () => {
|
||||
new URL("https://deno.land/std/http/server.ts");
|
||||
new URL("https://deno.land/std/http/server.ts");
|
||||
});
|
||||
|
||||
Deno.bench("parse url 200x", { group: "url" }, () => {
|
||||
for (let i = 0; i < 200; i++) {
|
||||
new URL("https://deno.land/std/http/server.ts");
|
||||
}
|
||||
});
|
|
@ -395,7 +395,7 @@ pub mod reporter {
|
|||
} else {
|
||||
s.push_str(&format!(
|
||||
"{}\n {}",
|
||||
colors::bold("summary"),
|
||||
colors::gray("summary"),
|
||||
colors::cyan_bold(&baseline.name)
|
||||
));
|
||||
|
||||
|
|
|
@ -178,13 +178,6 @@ impl BenchReporter for ConsoleReporter {
|
|||
}
|
||||
|
||||
Some(group) => {
|
||||
if self.group.is_none()
|
||||
&& self.has_ungrouped
|
||||
&& self.group_measurements.is_empty()
|
||||
{
|
||||
println!();
|
||||
}
|
||||
|
||||
if self.group.is_none() || group != self.group.as_ref().unwrap() {
|
||||
self.report_group_summary();
|
||||
}
|
||||
|
@ -192,7 +185,7 @@ impl BenchReporter for ConsoleReporter {
|
|||
if (self.group.is_none() && self.has_ungrouped)
|
||||
|| (self.group.is_some() && self.group_measurements.is_empty())
|
||||
{
|
||||
println!();
|
||||
println!("{} {}", colors::gray("group"), colors::green(group));
|
||||
}
|
||||
|
||||
self.group = Some(group.clone());
|
||||
|
@ -212,7 +205,6 @@ impl BenchReporter for ConsoleReporter {
|
|||
}
|
||||
|
||||
let options = self.options.as_ref().unwrap();
|
||||
|
||||
match result {
|
||||
BenchResult::Ok(stats) => {
|
||||
let mut desc = desc.clone();
|
||||
|
@ -296,6 +288,7 @@ impl BenchReporter for ConsoleReporter {
|
|||
)
|
||||
);
|
||||
}
|
||||
println!();
|
||||
|
||||
self.baseline = false;
|
||||
self.group_measurements.clear();
|
||||
|
|
Loading…
Reference in a new issue