Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshots: move "op_npm_process_state" to "ext/node" #21135

Closed
bartlomieju opened this issue Nov 10, 2023 · 0 comments · Fixed by #21127
Closed

Snapshots: move "op_npm_process_state" to "ext/node" #21135

bartlomieju opened this issue Nov 10, 2023 · 0 comments · Fixed by #21127
Assignees
Labels
perf performance related refactor

Comments

@bartlomieju
Copy link
Member

This op should be moved to "ext/node":

deno/cli/ops/mod.rs

Lines 51 to 56 in 9010b8d

#[op2]
#[string]
fn op_npm_process_state(state: &mut OpState) -> Result<String, AnyError> {
let npm_resolver = state.borrow_mut::<Arc<dyn CliNpmResolver>>();
Ok(npm_resolver.get_npm_process_state())
}

To do that we need to move CliNpmResolver::get_npm_process_state to deno_node::NpmResolver. Since it's quite loosely typed (just serializes some data to a string) it should be straightforward.

CC @dsherret

@bartlomieju bartlomieju added perf performance related refactor labels Nov 10, 2023
littledivy added a commit that referenced this issue Nov 11, 2023
Closes #21135

~1ms startup time improvement

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
kt3k pushed a commit that referenced this issue Nov 17, 2023
Closes #21135

~1ms startup time improvement

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf performance related refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants