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

Spin out the ffi module into its own crate #2123

Closed
pascalkuthe opened this issue Jan 24, 2022 · 4 comments
Closed

Spin out the ffi module into its own crate #2123

pascalkuthe opened this issue Jan 24, 2022 · 4 comments

Comments

@pascalkuthe
Copy link
Contributor

Hi,

thank you for all the great work on PyO3.
For an extremly performance (and compile-time) sensitive project of mine I am only using the ffi component of PyO3 directly (this project is also per definition really unsafe so a safe-wrapper is not that useful to me as for other projects).
Therefore I'd like to remove the dependency on PyO3 itself while still retaining access to the well maintained ffi module (to reduce compile times)

I have considered using python3-sys.
However it seems that this crate does not expose functions that are not part of the stable ABI (which I require).

To my understanding this would mostly involve moving some files around and replacing all uses of pyo3::ffi with pyo3_ffi (or whatever the name of the crate would be). While I do not know the codebase well I could prepare a PR myself it that would be desired

@pascalkuthe pascalkuthe changed the title Spin out the ffi module Spin out the ffi module into its own crate Jan 24, 2022
@davidhewitt
Copy link
Member

Hi, thanks for asking about this. I've wondered about this split myself. You're right that it should be quite straightforward. We can even re-export pub use pyo3_ffi as ffi so that this change is completely backwards compatible on an API level.

To understand if it's really worth the additional complexity, I'd welcome a PR so we can see how much it really does improve compile times. If we can show measurable improvements, I'd be ok to see this split.

@mejrs
Copy link
Member

mejrs commented Jan 24, 2022

Note that you can disable the macros feature, which will speed up compilation times.

If we can show measurable improvements, I'd be ok to see this split.

That's what I'm thinking as well.

@pascalkuthe
Copy link
Contributor Author

I created a PR #2126

@davidhewitt
Copy link
Member

Done in #2126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants