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

Cache the retrieval of python executable location #134

Closed
tdejager opened this issue Dec 23, 2023 · 0 comments · Fixed by #160
Closed

Cache the retrieval of python executable location #134

tdejager opened this issue Dec 23, 2023 · 0 comments · Fixed by #160
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tdejager
Copy link
Contributor

In #128 we have moved away from the which crate to do the retrieval of the path to the python interpreter with a mix of logic and sub-process.

@pradyunsg correctly pointed out that:

Not something that needed to happen in this PR but... given the move away from a few stat calls to a subprocess, consider caching the results of system_python_executable across the entire process since it's unlikely to change and you can avoid this overhead on every environment creation + bytecode compile call etc.

Would be good to actually do this and should be relatively straightforward.

@tdejager tdejager added enhancement New feature or request good first issue Good for newcomers labels Dec 23, 2023
tdejager pushed a commit that referenced this issue Jan 22, 2024
closes #134 

I've decided to not introduce lazy_static as dependency, and to use
OnceLock
https://github.com/rust-lang-nursery/lazy-static.rs/pull/216/files ( in
my case, sync::OnceCell )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant