summaryrefslogtreecommitdiff
path: root/bench_util
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-02-04 17:03:14 -0700
committerGitHub <noreply@github.com>2024-02-04 17:03:14 -0700
commit56f58a047e3c1cc27ff55988f25173cc18ef6aeb (patch)
tree2a7a288c385d54d1384c00c20cdbc168a046218f /bench_util
parent0f7f98795129f3f6bef51d08da9accca5e9ca9cc (diff)
chore: bump deno core (#22243)
Migrations: - Error registration no longer required for Interrupted or BadResource (these are core exception) - `include_js_files!`/`ExtensionFileSource` changes
Diffstat (limited to 'bench_util')
-rw-r--r--bench_util/benches/utf8.rs22
1 files changed, 9 insertions, 13 deletions
diff --git a/bench_util/benches/utf8.rs b/bench_util/benches/utf8.rs
index 783983dcb..48af4dba7 100644
--- a/bench_util/benches/utf8.rs
+++ b/bench_util/benches/utf8.rs
@@ -6,27 +6,23 @@ use deno_bench_util::bencher::benchmark_group;
use deno_bench_util::bencher::Bencher;
use deno_bench_util::BenchOptions;
use deno_core::Extension;
-use deno_core::ExtensionFileSource;
-use deno_core::ExtensionFileSourceCode;
fn setup() -> Vec<Extension> {
- vec![Extension {
- name: "bench_setup",
- js_files: std::borrow::Cow::Borrowed(&[ExtensionFileSource {
- specifier: "ext:bench_setup/setup.js",
- code: ExtensionFileSourceCode::IncludedInBinary(
- r#"
+ deno_core::extension!(
+ bench_setup,
+ js = ["ext:bench_setup/setup.js" = {
+ source = r#"
const hello = "hello world\n";
const hello1k = hello.repeat(1e3);
const hello1m = hello.repeat(1e6);
const helloEncoded = Deno.core.encode(hello);
const hello1kEncoded = Deno.core.encode(hello1k);
const hello1mEncoded = Deno.core.encode(hello1m);
- "#,
- ),
- }]),
- ..Default::default()
- }]
+ "#
+ }]
+ );
+
+ vec![bench_setup::init_ops_and_esm()]
}
fn bench_utf8_encode_12_b(b: &mut Bencher) {