diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-11-11 09:01:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-11 17:01:48 +0000 |
commit | 9f4a45561f4a01019cdbff86e2056de0296e791b (patch) | |
tree | a9c2c4b1664d6f4640115345882ae068c1a5a216 /cli/npm/byonm.rs | |
parent | 56e76242f3d7082e412bc698ebc737d24910cb60 (diff) |
perf: snapshot runtime ops (#21127)
Closes https://github.com/denoland/deno/issues/21135
~1ms startup time improvement
---------
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Diffstat (limited to 'cli/npm/byonm.rs')
-rw-r--r-- | cli/npm/byonm.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cli/npm/byonm.rs b/cli/npm/byonm.rs index da36e3b53..469f98828 100644 --- a/cli/npm/byonm.rs +++ b/cli/npm/byonm.rs @@ -82,6 +82,16 @@ impl ByonmCliNpmResolver { } impl NpmResolver for ByonmCliNpmResolver { + fn get_npm_process_state(&self) -> String { + serde_json::to_string(&NpmProcessState { + kind: NpmProcessStateKind::Byonm, + local_node_modules_path: Some( + self.root_node_modules_dir.to_string_lossy().to_string(), + ), + }) + .unwrap() + } + fn resolve_package_folder_from_package( &self, name: &str, @@ -248,16 +258,6 @@ impl CliNpmResolver for ByonmCliNpmResolver { ) } - fn get_npm_process_state(&self) -> String { - serde_json::to_string(&NpmProcessState { - kind: NpmProcessStateKind::Byonm, - local_node_modules_path: Some( - self.root_node_modules_dir.to_string_lossy().to_string(), - ), - }) - .unwrap() - } - fn check_state_hash(&self) -> Option<u64> { // it is very difficult to determine the check state hash for byonm // so we just return None to signify check caching is not supported |