diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-04-01 09:10:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-01 09:10:04 -0400 |
commit | 240b362c002d17bc2b676673ed1b9406683ff0c2 (patch) | |
tree | d0c3cdc099b7cac4f29ae17f7ba03ee01a01c877 /cli/resolver.rs | |
parent | 8d158058e5abab14d122712a716979b865620995 (diff) |
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.
Diffstat (limited to 'cli/resolver.rs')
-rw-r--r-- | cli/resolver.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/resolver.rs b/cli/resolver.rs index 6594bf2d4..fc326e1b1 100644 --- a/cli/resolver.rs +++ b/cli/resolver.rs @@ -36,6 +36,7 @@ use std::collections::HashMap; use std::collections::HashSet; use std::path::Path; use std::path::PathBuf; +use std::rc::Rc; use std::sync::Arc; use crate::args::package_json::PackageJsonDeps; @@ -98,7 +99,7 @@ impl CliNodeResolver { &self, referrer: &ModuleSpecifier, permissions: &dyn NodePermissions, - ) -> Result<Option<PackageJson>, AnyError> { + ) -> Result<Option<Rc<PackageJson>>, AnyError> { self .node_resolver .get_closest_package_json(referrer, permissions) |