1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-28 18:19:08 -05:00
denoland-deno/cli/tests/testdata/bench
Nayeem Rahman 5dbf5c8293
fix(bench): explicit timers don't force high precision measurements (#20272)
Disables `BenchContext::start()` and `BenchContext::end()` for low
precision benchmarks (less than 0.01s per iteration). Prints a warning
when they are used in such benchmarks, suggesting to remove them.

```ts
Deno.bench("noop", { group: "noops" }, () => {});

Deno.bench("noop with start/end", { group: "noops" }, (b) => {
  b.start();
  b.end();
});
```

Before:
```
cpu: 12th Gen Intel(R) Core(TM) i9-12900K
runtime: deno 1.36.2 (x86_64-unknown-linux-gnu)

file:///home/nayeem/projects/deno/temp3.ts
benchmark                    time (avg)        iter/s             (min … max)       p75       p99      p995
----------------------------------------------------------------------------- -----------------------------


noop                          2.63 ns/iter 380,674,131.4    (2.45 ns … 27.78 ns)   2.55 ns   4.03 ns   5.33 ns
noop with start and end     302.47 ns/iter   3,306,146.0     (200 ns … 151.2 µs)    300 ns    400 ns    400 ns

summary
  noop
   115.14x faster than noop with start and end
```

After:
```
cpu: 12th Gen Intel(R) Core(TM) i9-12900K
runtime: deno 1.36.1 (x86_64-unknown-linux-gnu)

file:///home/nayeem/projects/deno/temp3.ts
benchmark                    time (avg)        iter/s             (min … max)       p75       p99      p995
----------------------------------------------------------------------------- -----------------------------


noop                          3.01 ns/iter 332,565,561.7    (2.73 ns … 29.54 ns)   2.93 ns   5.29 ns   7.45 ns
noop with start and end       7.73 ns/iter 129,291,091.5    (6.61 ns … 46.76 ns)   7.87 ns  13.12 ns  15.32 ns
Warning start() and end() calls in "noop with start and end" are ignored because it averages less than 0.01s per iteration. Remove them for better results.

summary
  noop
   2.57x faster than noop with start and end
```
2023-08-26 11:29:45 +02:00
..
collect feat(cli): flatten deno.json configuaration (#17799) 2023-04-26 23:02:36 -04:00
filter
allow_all.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
allow_all.ts
allow_none.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
allow_none.ts
before_unload_prevent_default.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
before_unload_prevent_default.ts fix(test): disable preventDefault() for beforeunload event (#18911) 2023-05-03 23:10:51 +02:00
bench_formatting.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
bench_formatting.ts fix(cli): formatting bench with colors (#19323) 2023-06-07 12:27:25 +02:00
check_local_by_default.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
check_local_by_default.ts feat: subcommands type-check only local files by default (#14623) 2022-05-17 23:53:42 +02:00
check_local_by_default2.out feat: subcommands type-check only local files by default (#14623) 2022-05-17 23:53:42 +02:00
check_local_by_default2.ts feat: subcommands type-check only local files by default (#14623) 2022-05-17 23:53:42 +02:00
clear_timeout.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
clear_timeout.ts
collect.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
collect2.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
collect_with_malformed_config.out feat(cli): flatten deno.json configuaration (#17799) 2023-04-26 23:02:36 -04:00
exit_sanitizer.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
exit_sanitizer.ts
explicit_start_and_end.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
explicit_start_and_end.ts feat(bench): add BenchContext::start() and BenchContext::end() (#18734) 2023-07-31 12:02:59 +02:00
explicit_start_and_end_low_precision.out fix(bench): explicit timers don't force high precision measurements (#20272) 2023-08-26 11:29:45 +02:00
explicit_start_and_end_low_precision.ts fix(bench): explicit timers don't force high precision measurements (#20272) 2023-08-26 11:29:45 +02:00
fail.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
fail.ts
file_protocol.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
file_protocol.ts fix(test/bench): accept file protocol module specifier CLI args (#14429) 2022-05-02 15:43:03 -04:00
filter.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
finally_timeout.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
finally_timeout.ts
group_baseline.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
group_baseline.ts chore: fix flaky integration::bench::multifile_summary test (#14771) 2022-06-02 03:03:28 +02:00
ignore.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
ignore.ts
ignore_permissions.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
ignore_permissions.ts
interval.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
interval.ts
load_unload.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
load_unload.ts
meta.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
meta.ts
multifile_summary.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
no_check.out feat(bench): update API, new console reporter (#14305) 2022-04-20 21:06:39 +02:00
no_check.ts
no_color.ts
no_prompt_by_default.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
no_prompt_by_default.ts
no_prompt_with_denied_perms.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
no_prompt_with_denied_perms.ts
no_run.out feat(bench): add --no-run flag (#18433) 2023-03-26 14:55:58 +00:00
no_run.ts feat(bench): add --no-run flag (#18433) 2023-03-26 14:55:58 +00:00
only.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
only.ts
overloads.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
overloads.ts
pass.json.out feat(bench): change --json output format (#17888) 2023-02-23 12:59:23 +01:00
pass.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
pass.ts
quiet.out feat(bench): print iter/s in the report (#19994) 2023-08-01 23:55:23 +00:00
quiet.ts
recursive_permissions_pledge.js refactor: remove Deno.core (#16881) 2023-01-24 18:54:10 +01:00
unhandled_rejection.out feat(bench): update API, new console reporter (#14305) 2022-04-20 21:06:39 +02:00
unhandled_rejection.ts
unresolved_promise.out feat(core): show unresolved promise origin (#16650) 2022-11-28 23:07:23 +01:00
unresolved_promise.ts