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

Don't launch subprocess for pip_deepfreeze #4

Open
Bobronium opened this issue Jan 25, 2023 · 2 comments
Open

Don't launch subprocess for pip_deepfreeze #4

Bobronium opened this issue Jan 25, 2023 · 2 comments

Comments

@Bobronium
Copy link

Bobronium commented Jan 25, 2023

Since it's just a python lib, it should be possible to just import it and use its entrypoint to perform needed actions.
This will benefit the speed, since there's not going to be the whole new interpreted startup needed, and pip_freeze will reuse already imported modules in current interpreter process.

I'm willing to make a PR if you find this desired and don't see potential shortcomings of suggested approach.

@sbidoul
Copy link
Owner

sbidoul commented Jan 26, 2023

Before doing a PR here, we would first need to expose and document a stable public api in pip-deepfreeze.

That might be interesting but first we should check that it significantly improves performance.

Indeed, by design, pip-deepfreeze does several pip subprocess calls, so the pip-deepfreeze subprocess invocation time may be dwarfed by that.

@Bobronium
Copy link
Author

Bobronium commented Jan 26, 2023

Indeed, by design, pip-deepfreeze does several pip subprocess calls, so the pip-deepfreeze subprocess invocation time may be dwarfed by that.

Interesting point that I didn't think about. Yeah, it's definitely worth measuring then.

Before doing a PR here, we would first need to expose and document a stable public api in pip-deepfreeze.

I wouldn't say it's required, since we can just set needed sys.args and use pip-deepfreeze's entrypoint.

Not to say that public API would be unwanted, but rather that not having one is not necessarily a blocker.

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

No branches or pull requests

2 participants