summaryrefslogtreecommitdiff
path: root/op_crates/url/benches
diff options
context:
space:
mode:
authorAndy Hayden <andyhayden1@gmail.com>2021-04-30 12:51:48 -0700
committerGitHub <noreply@github.com>2021-04-30 15:51:48 -0400
commit684c357136fd44f9d5a1b8bb4402400ed1354677 (patch)
treeebc14b1d01b6643dd4d588516692dffc0f8fcb52 /op_crates/url/benches
parentabaec7a88e991188d885bede652f35d76ab4f340 (diff)
Rename crate_ops to extensions (#10431)
Diffstat (limited to 'op_crates/url/benches')
-rw-r--r--op_crates/url/benches/url_ops.rs35
1 files changed, 0 insertions, 35 deletions
diff --git a/op_crates/url/benches/url_ops.rs b/op_crates/url/benches/url_ops.rs
deleted file mode 100644
index 8b3cf2705..000000000
--- a/op_crates/url/benches/url_ops.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-use bencher::{benchmark_group, benchmark_main, Bencher};
-
-use deno_core::v8;
-use deno_core::JsRuntime;
-use deno_core::RuntimeOptions;
-
-fn create_js_runtime() -> JsRuntime {
- let mut runtime = JsRuntime::new(RuntimeOptions {
- extensions: vec![deno_url::init()],
- ..Default::default()
- });
-
- runtime
- .execute("setup", "const { URL } = globalThis.__bootstrap.url;")
- .unwrap();
-
- runtime
-}
-
-pub fn bench_runtime_js(b: &mut Bencher, src: &str) {
- let mut runtime = create_js_runtime();
- let scope = &mut runtime.handle_scope();
- let code = v8::String::new(scope, src).unwrap();
- let script = v8::Script::compile(scope, code, None).unwrap();
- b.iter(|| {
- script.run(scope).unwrap();
- });
-}
-
-fn bench_url_parse(b: &mut Bencher) {
- bench_runtime_js(b, r#"new URL(`http://www.google.com/`);"#);
-}
-
-benchmark_group!(benches, bench_url_parse,);
-benchmark_main!(benches);