From 92b2e28c6491f339124ec5851173ac0aaef93908 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Sun, 24 Dec 2023 06:04:32 -0700 Subject: chore: ensure that each op provided to ensureFastOps is only used once (#21689) When we migrate to op-import-per-extension, we will want to ensure that ops have one and only one place where they are imported. This tackles the ops that are imported via `ensureFastOps`, but does not yet tackle direct `ops` imports. Landing ahead of https://github.com/denoland/deno_core/pull/393 --- cli/bench/async_ops_deferred.js | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 cli/bench/async_ops_deferred.js (limited to 'cli') diff --git a/cli/bench/async_ops_deferred.js b/cli/bench/async_ops_deferred.js deleted file mode 100644 index 2751ad226..000000000 --- a/cli/bench/async_ops_deferred.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -const queueMicrotask = globalThis.queueMicrotask || process.nextTick; -let [total, count] = typeof Deno !== "undefined" - ? Deno.args - : [process.argv[2], process.argv[3]]; - -total = total ? parseInt(total, 0) : 50; -count = count ? parseInt(count, 10) : 1000000; - -async function bench(fun) { - const start = Date.now(); - for (let i = 0; i < count; i++) await fun(); - const elapsed = Date.now() - start; - const rate = Math.floor(count / (elapsed / 1000)); - console.log(`time ${elapsed} ms rate ${rate}`); - if (--total) queueMicrotask(() => bench(fun)); -} - -const core = Deno[Deno.internal].core; -const ops = core.ops; -const opVoidAsyncDeferred = ops.op_void_async_deferred; -bench(() => opVoidAsyncDeferred()); -- cgit v1.2.3