summaryrefslogtreecommitdiff
path: root/ext/web/benches/timers_ops.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-08-28 12:21:49 +0530
committerGitHub <noreply@github.com>2022-08-28 12:21:49 +0530
commitd8396225c4287c53dd42226266e9f66983125e51 (patch)
tree27516437c40b80596f4d0fc9b821882a0f2a0ca1 /ext/web/benches/timers_ops.rs
parent7c4f57e8b091bc386242f83b5373e4bb33382012 (diff)
perf: use fast api for op_now (#15643)
Diffstat (limited to 'ext/web/benches/timers_ops.rs')
-rw-r--r--ext/web/benches/timers_ops.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/ext/web/benches/timers_ops.rs b/ext/web/benches/timers_ops.rs
index f5d03d6c3..10b434015 100644
--- a/ext/web/benches/timers_ops.rs
+++ b/ext/web/benches/timers_ops.rs
@@ -1,8 +1,8 @@
use deno_core::Extension;
+use deno_bench_util::bench_js_async;
use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::{benchmark_group, Bencher};
-use deno_bench_util::{bench_js_async, bench_js_sync};
use deno_web::BlobStore;
struct Permissions;
@@ -27,7 +27,7 @@ fn setup() -> Vec<Extension> {
Extension::builder()
.js(vec![
("setup", r#"
- const { opNow, setTimeout, handleTimerMacrotask } = globalThis.__bootstrap.timers;
+ const { setTimeout, handleTimerMacrotask } = globalThis.__bootstrap.timers;
Deno.core.setMacrotaskCallback(handleTimerMacrotask);
"#),
])
@@ -39,13 +39,9 @@ fn setup() -> Vec<Extension> {
]
}
-fn bench_op_now(b: &mut Bencher) {
- bench_js_sync(b, r#"opNow();"#, setup);
-}
-
fn bench_set_timeout(b: &mut Bencher) {
bench_js_async(b, r#"setTimeout(() => {}, 0);"#, setup);
}
-benchmark_group!(benches, bench_op_now, bench_set_timeout,);
+benchmark_group!(benches, bench_set_timeout,);
bench_or_profile!(benches);