mirror of
https://github.com/denoland/deno.git
synced 2024-10-30 09:08:00 -04:00
5dbf5c8293
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 ``` |
||
---|---|---|
.. | ||
collect | ||
filter | ||
allow_all.out | ||
allow_all.ts | ||
allow_none.out | ||
allow_none.ts | ||
before_unload_prevent_default.out | ||
before_unload_prevent_default.ts | ||
bench_formatting.out | ||
bench_formatting.ts | ||
check_local_by_default.out | ||
check_local_by_default.ts | ||
check_local_by_default2.out | ||
check_local_by_default2.ts | ||
clear_timeout.out | ||
clear_timeout.ts | ||
collect.out | ||
collect2.out | ||
collect_with_malformed_config.out | ||
exit_sanitizer.out | ||
exit_sanitizer.ts | ||
explicit_start_and_end.out | ||
explicit_start_and_end.ts | ||
explicit_start_and_end_low_precision.out | ||
explicit_start_and_end_low_precision.ts | ||
fail.out | ||
fail.ts | ||
file_protocol.out | ||
file_protocol.ts | ||
filter.out | ||
finally_timeout.out | ||
finally_timeout.ts | ||
group_baseline.out | ||
group_baseline.ts | ||
ignore.out | ||
ignore.ts | ||
ignore_permissions.out | ||
ignore_permissions.ts | ||
interval.out | ||
interval.ts | ||
load_unload.out | ||
load_unload.ts | ||
meta.out | ||
meta.ts | ||
multifile_summary.out | ||
no_check.out | ||
no_check.ts | ||
no_color.ts | ||
no_prompt_by_default.out | ||
no_prompt_by_default.ts | ||
no_prompt_with_denied_perms.out | ||
no_prompt_with_denied_perms.ts | ||
no_run.out | ||
no_run.ts | ||
only.out | ||
only.ts | ||
overloads.out | ||
overloads.ts | ||
pass.json.out | ||
pass.out | ||
pass.ts | ||
quiet.out | ||
quiet.ts | ||
recursive_permissions_pledge.js | ||
unhandled_rejection.out | ||
unhandled_rejection.ts | ||
unresolved_promise.out | ||
unresolved_promise.ts |