summaryrefslogtreecommitdiff
path: root/bench_util/benches/utf8.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2023-07-31 19:19:15 +0100
committerGitHub <noreply@github.com>2023-07-31 18:19:15 +0000
commitd5efdeeff149202b24011918984a15389dae98a2 (patch)
tree4309ef635129b3f6dc5ed5e07a99d0fae23a4020 /bench_util/benches/utf8.rs
parent99daad054102dbca7fad704d5e81ada1357331fd (diff)
refactor: update core extension api usage (#19952)
Diffstat (limited to 'bench_util/benches/utf8.rs')
-rw-r--r--bench_util/benches/utf8.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/bench_util/benches/utf8.rs b/bench_util/benches/utf8.rs
index 9bc7cdaee..242fb2bfc 100644
--- a/bench_util/benches/utf8.rs
+++ b/bench_util/benches/utf8.rs
@@ -10,21 +10,23 @@ use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;
fn setup() -> Vec<Extension> {
- vec![Extension::builder("bench_setup")
- .js(vec![ExtensionFileSource {
+ vec![Extension {
+ name: "bench_setup",
+ js_files: std::borrow::Cow::Borrowed(&[ExtensionFileSource {
specifier: "ext:bench_setup/setup.js",
code: ExtensionFileSourceCode::IncludedInBinary(
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);
+ 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);
"#,
),
- }])
- .build()]
+ }]),
+ ..Default::default()
+ }]
}
fn bench_utf8_encode_12_b(b: &mut Bencher) {