From 240b362c002d17bc2b676673ed1b9406683ff0c2 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 1 Apr 2024 09:10:04 -0400 Subject: perf(node): put pkg json into an `Rc` (#23156) Was doing a bit of debugging on why some stuff is not working in a personal project and ran a quick debug profile and saw it cloning the pkg json a lot. We should put this in an Rc. --- cli/npm/byonm.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli/npm') diff --git a/cli/npm/byonm.rs b/cli/npm/byonm.rs index d17be0e95..1e61ce885 100644 --- a/cli/npm/byonm.rs +++ b/cli/npm/byonm.rs @@ -3,6 +3,7 @@ use std::borrow::Cow; use std::path::Path; use std::path::PathBuf; +use std::rc::Rc; use std::sync::Arc; use deno_ast::ModuleSpecifier; @@ -52,7 +53,7 @@ impl ByonmCliNpmResolver { &self, dep_name: &str, referrer: &ModuleSpecifier, - ) -> Option { + ) -> Option> { let referrer_path = referrer.to_file_path().ok()?; let mut current_folder = referrer_path.parent()?; loop { -- cgit v1.2.3