1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-23 15:16:54 -05:00
denoland-deno/ext/url/benches/url_ops.rs
Aaron O'Mullan f5c31b56e3
Revert "core: don't include_str extension js code (#10786)" (#14614)
This reverts commit 10e50a1207

Alternative to #13217, IMO the tradeoffs made by #10786 aren't worth it.

It breaks abstractions (crates being self-contained, deno_core without snapshotting etc...) and causes pain points / gotchas for both embedders & devs for a relatively minimal gain in incremental build time ...

Closes #11030
2022-05-15 13:27:56 +02:00

25 lines
576 B
Rust

use deno_bench_util::bench_js_sync;
use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::{benchmark_group, Bencher};
use deno_core::Extension;
fn setup() -> Vec<Extension> {
vec![
deno_webidl::init(),
deno_url::init(),
Extension::builder()
.js(vec![(
"setup",
"const { URL } = globalThis.__bootstrap.url;",
)])
.build(),
]
}
fn bench_url_parse(b: &mut Bencher) {
bench_js_sync(b, r#"new URL(`http://www.google.com/`);"#, setup);
}
benchmark_group!(benches, bench_url_parse,);
bench_or_profile!(benches);