diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-12-24 06:04:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-24 13:04:32 +0000 |
commit | 92b2e28c6491f339124ec5851173ac0aaef93908 (patch) | |
tree | 3910827b2772379054c15c4c3f133175138baf36 /cli/bench | |
parent | 1297c9a8f379d89691522c5cc0c6071c479e95a1 (diff) |
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
Diffstat (limited to 'cli/bench')
-rw-r--r-- | cli/bench/async_ops_deferred.js | 22 |
1 files changed, 0 insertions, 22 deletions
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()); |