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

perf: do not clone version information #78

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

dsherret
Copy link
Member

No description provided.

@@ -537,11 +538,11 @@ impl NpmRegistryApi for TestNpmRegistryApi {
name: &str,
) -> Result<Arc<NpmPackageInfo>, NpmRegistryPackageInfoLoadError> {
let infos = self.package_infos.borrow();
Ok(Arc::new(infos.get(name).cloned().ok_or_else(|| {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clone was very noisy in benchmarks. It was causing a benchmark to run in 115ms instead of 10ms.

@dsherret dsherret requested a review from nathanwhit December 19, 2024 23:51
Copy link
Member

@nathanwhit nathanwhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM!

@dsherret dsherret merged commit 8dd6d16 into denoland:main Dec 20, 2024
1 check passed
@dsherret dsherret deleted the perf_reduce_clone_package_info branch December 20, 2024 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants