Skip to content

cffi vs. Python C Extension #57

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

Closed
davidblewett opened this issue Nov 3, 2016 · 3 comments
Closed

cffi vs. Python C Extension #57

davidblewett opened this issue Nov 3, 2016 · 3 comments

Comments

@davidblewett
Copy link

davidblewett commented Nov 3, 2016

I am curious about the choice to use a Python C extension vs. using cffi? cffi should be easier to maintain, be much more performant on alternative runtimes (PyPy [1]), and core developers advocate for it [2]. There are high profile projects using it (pyzmq for example [3]). The documentation is pretty good [4], and instructions for packaging have gotten much simpler in recent months [5].

  1. http://doc.pypy.org/en/latest/faq.html#see-below
  2. http://www.snarky.ca/try-to-not-use-the-c-api-directly
  3. https://github.com/zeromq/pyzmq
  4. http://cffi.readthedocs.io/en/latest/overview.html
  5. https://caremad.io/posts/2015/06/distributing-a-cffi-project-redux/
@davidblewett
Copy link
Author

Just wanted to clarify that I do appreciate the work put in for the current implementation. Our largest use case for Kafka from Python is built on PyPy. That generally limits our options to either pure Python libraries or ones using cffi to wrap underlying C libraries. Would you be interested in something that tried to straddle this divide similar to how pyzmq offers both a Cython and a cffi backend?

@jeffwidman
Copy link
Contributor

Also curious to know the answer here.

@edenhill
Copy link
Contributor

edenhill commented Nov 8, 2016

Our experience, and also input from the Pykafka folks, is that CFFI performance was going to be a problem.

It is unlikely that we'll provide a dual stack implementation any time soon,
if you are a customer, feel free to raise through support and this will help us prioritize.

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

3 participants