diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-03-29 01:12:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 01:12:19 +0200 |
commit | 269ea88e0e9a8c5e773d178e9d32ee6c920e1907 (patch) | |
tree | 0f2de773c40bda2a85a4f5e36d80fb1d615e93d4 /cli/bench/deno_common.js | |
parent | 00468bceffc7bc13c33d175df6058959518f687f (diff) |
bench: track Date.now() as upper bound reference (#9922)
Diffstat (limited to 'cli/bench/deno_common.js')
-rw-r--r-- | cli/bench/deno_common.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/cli/bench/deno_common.js b/cli/bench/deno_common.js index 831c26cfa..3db1ce337 100644 --- a/cli/bench/deno_common.js +++ b/cli/bench/deno_common.js @@ -20,8 +20,14 @@ function benchUrlParse() { }); } -function benchNow() { - benchSync("now", 5e5, () => { +function benchDateNow() { + benchSync("date_now", 5e5, () => { + Date.now(); + }); +} + +function benchPerfNow() { + benchSync("perf_now", 5e5, () => { performance.now(); }); } @@ -46,9 +52,15 @@ function benchReadZero() { } function main() { + // v8 builtin that's close to the upper bound non-NOPs + benchDateNow(); + // A very lightweight op, that should be highly optimizable + benchPerfNow(); + // A common "language feature", that should be fast + // also a decent representation of a non-trivial JSON-op benchUrlParse(); - benchNow(); - benchWriteNull(); + // IO ops benchReadZero(); + benchWriteNull(); } main(); |