deno/cli/tools
Nathan Whitaker a2a537e196
fix(bench): Fix group header printing logic + don't filter out the warmup benchmark (#23083)
Fixes #23053.
Two small bugs here:
- the existing condition for printing out the group header was broken.
it worked in the reproducer (in the issue above) without filtering only
by accident, due to setting `self.has_ungrouped = true` once we see the
warmup bench. Knowing that we sort benchmarks to put ungrouped benches
first, there are only two cases: 1) we are starting the first group 2)
we are ending the previous group and starting a new group
- when you passed `--filter` we were applying that filter to the warmup
bench (which is not visible to users), so we suffered from jit bias if
you were filtering (unless your filter was `<warmup>`)

TLDR;

Running
```bash
deno bench main.js --filter="G"
```
```js
// main.js
Deno.bench({
  group: "G1",
  name: "G1-A",
  fn() {},
});

Deno.bench({
  group: "G1",
  name: "G1-B",
  fn() {},
});
```


Before this PR:
```
benchmark      time (avg)        iter/s             (min … max)       p75       p99      p995
--------------------------------------------------------------- -----------------------------

G1-A          303.52 ps/iter3,294,726,102.1     (254.2 ps … 7.8 ns) 287.5 ps 391.7 ps 437.5 ps
G1-B             3.8 ns/iter 263,360,635.9     (2.24 ns … 8.36 ns) 3.84 ns 4.73 ns 4.94 ns

summary
  G1-A
   12.51x faster than G1-B
```

After this PR:
```
benchmark      time (avg)        iter/s             (min … max)       p75       p99      p995
--------------------------------------------------------------- -----------------------------

group G1
G1-A            3.85 ns/iter 259,822,096.0     (2.42 ns … 9.03 ns) 3.83 ns 4.62 ns 4.83 ns
G1-B            3.84 ns/iter 260,458,274.5     (3.55 ns … 7.05 ns) 3.83 ns 4.45 ns 4.7 ns

summary
  G1-B
   1x faster than G1-A
```
2024-03-26 09:19:24 -07:00
..
bench fix(bench): Fix group header printing logic + don't filter out the warmup benchmark (#23083) 2024-03-26 09:19:24 -07:00
coverage fix(coverage): Error if no files are included in the report (#22952) 2024-03-15 20:58:57 -07:00
init chore: enable clippy unused_async rule (#22834) 2024-03-11 23:48:00 -04:00
jupyter chore(tests): Introduce integration tests for jupyter subcommand (#23074) 2024-03-25 17:53:50 -07:00
lint refactor(lsp): unify config file data into ConfigTree (#23032) 2024-03-26 15:52:20 +00:00
registry feat(publish): check for uncommitted files in deno publish --dry-run (#22981) 2024-03-22 12:41:33 -07:00
repl fix(cli): output more detailed information for steps when using JUnit reporter (#22797) 2024-03-26 00:08:46 +09:00
run chore: enable clippy unused_async rule (#22834) 2024-03-11 23:48:00 -04:00
test fix(cli): output more detailed information for steps when using JUnit reporter (#22797) 2024-03-26 00:08:46 +09:00
vendor chore(cli): move away from PathBuf in clap (#22036) 2024-03-14 23:53:46 +00:00
bundle.rs chore: enable clippy unused_async rule (#22834) 2024-03-11 23:48:00 -04:00
check.rs fix(unstable/publish): repect --no-check in no-slow-types (#22653) 2024-03-01 15:54:46 +00:00
compile.rs chore(cli): move away from PathBuf in clap (#22036) 2024-03-14 23:53:46 +00:00
doc.rs chore: enable clippy unused_async rule (#22834) 2024-03-11 23:48:00 -04:00
fmt.rs chore: enable clippy unused_async rule (#22834) 2024-03-11 23:48:00 -04:00
info.rs chore: enable clippy unused_async rule (#22834) 2024-03-11 23:48:00 -04:00
installer.rs chore(cli): move away from PathBuf in clap (#22036) 2024-03-14 23:53:46 +00:00
mod.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
task.rs chore: enable clippy unused_async rule (#22834) 2024-03-11 23:48:00 -04:00
upgrade.rs chore(cli): move away from PathBuf in clap (#22036) 2024-03-14 23:53:46 +00:00