summaryrefslogtreecommitdiff
path: root/bench_util/benches/utf8.rs
diff options
context:
space:
mode:
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) {