Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Incremental reporting of Conda envs #28

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

Merged
merged 10 commits into from
Jun 7, 2024
Merged

Conversation

DonJayamanne
Copy link
Collaborator

No description provided.

@@ -39,5 +40,5 @@ pub trait Locator: Send + Sync {
/**
* Finds all environments specific to this locator.
*/
fn find(&self) -> Option<LocatorResult>;
fn find(&self, reporter: &dyn Reporter);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Previously we'd report as soon as each locator finds environments.
Thats very fast.
However I can see conda getting slower and slower.
E.g. everything completes in < 50ms for me, except for conda.
Now that I have installed 30 conda envs, and 8 conda installs, it takes 100-200ms
So, first conda gets reported only after all conda envs have been disccovered.

The change is to now report immediately as they are discovered.
Perf is still the same, perhaps slightly faster,

let env = env.to_python_environment(None, None);
let mut environments = self.environments.lock().unwrap();
environments.insert(prefix, env.clone());
reporter.report_environment(&env);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as soon as we discover anything we report it.
Previously we-d collect and return to calling code.

@DonJayamanne DonJayamanne requested a review from karthiknadig June 7, 2024 03:57
@DonJayamanne DonJayamanne marked this pull request as ready for review June 7, 2024 03:57
@DonJayamanne DonJayamanne merged commit 8965999 into main Jun 7, 2024
24 checks passed
@DonJayamanne DonJayamanne deleted the incrementalReporting branch June 7, 2024 04:13
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