mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
bench: track Date.now() as upper bound reference (#9922)
This commit is contained in:
parent
00468bceff
commit
269ea88e0e
1 changed files with 16 additions and 4 deletions
|
@ -20,8 +20,14 @@ function benchUrlParse() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function benchNow() {
|
function benchDateNow() {
|
||||||
benchSync("now", 5e5, () => {
|
benchSync("date_now", 5e5, () => {
|
||||||
|
Date.now();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function benchPerfNow() {
|
||||||
|
benchSync("perf_now", 5e5, () => {
|
||||||
performance.now();
|
performance.now();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -46,9 +52,15 @@ function benchReadZero() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function main() {
|
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();
|
benchUrlParse();
|
||||||
benchNow();
|
// IO ops
|
||||||
benchWriteNull();
|
|
||||||
benchReadZero();
|
benchReadZero();
|
||||||
|
benchWriteNull();
|
||||||
}
|
}
|
||||||
main();
|
main();
|
||||||
|
|
Loading…
Reference in a new issue