summaryrefslogtreecommitdiff
path: root/runtime/build.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-03-17 16:15:27 -0600
committerGitHub <noreply@github.com>2023-03-17 22:15:27 +0000
commit3487fde236d0852a8b0672c293fa41a741f471e8 (patch)
treeaf466368147a08b787080446319a3a46a60ee37d /runtime/build.rs
parente55b448730160a6e4df9815a268d4049ac89deab (diff)
perf(core) Reduce copying and cloning in extension initialization (#18252)
Follow-up to #18210: * we are passing the generated `cfg` object into the state function rather than passing individual config fields * reduce cloning dramatically by making the state_fn `FnOnce` * `take` for `ExtensionBuilder` to avoid more unnecessary copies * renamed `config` to `options`
Diffstat (limited to 'runtime/build.rs')
-rw-r--r--runtime/build.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/runtime/build.rs b/runtime/build.rs
index c1837de82..df5a0c299 100644
--- a/runtime/build.rs
+++ b/runtime/build.rs
@@ -17,9 +17,7 @@ mod startup_snapshot {
use deno_core::snapshot_util::*;
use deno_core::Extension;
use deno_core::ExtensionFileSource;
- use std::cell::RefCell;
use std::path::Path;
- use std::rc::Rc;
fn transpile_ts_for_snapshotting(
file_source: &ExtensionFileSource,
@@ -292,9 +290,7 @@ mod startup_snapshot {
deno_tls::deno_tls::init_ops_and_esm(),
deno_napi::deno_napi::init_ops_and_esm::<Permissions>(),
deno_http::deno_http::init_ops_and_esm(),
- deno_io::deno_io::init_ops_and_esm(Rc::new(RefCell::new(Some(
- Default::default(),
- )))),
+ deno_io::deno_io::init_ops_and_esm(Default::default()),
deno_fs::deno_fs::init_ops_and_esm::<Permissions>(false),
deno_flash::deno_flash::init_ops_and_esm::<Permissions>(false), // No --unstable
runtime::init_ops_and_esm(),