Skip to content

Commit f0fb12d

Browse files
committed
o Add reference to @Duality4Y's experiment with PyPy and CFFI
binding. In context of hzeller#159
1 parent e10f9f0 commit f0fb12d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

python/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ sudo make install-python PYTHON=$(which python3)
2626
### PyPy
2727
The cython binding to PyPy seems to be somewhat working but extremely slow (20x
2828
slower even than the regular Python binding, 160x slower than C++), so this is
29-
not recommended. From glancing at the docs, the library might need to
30-
be bound via **[CFFI](https://cffi.readthedocs.io/)** first. If anyone has
31-
experience doing that, please consider preparing a pull request (ideally in
32-
a way that it can be used as well for Python2/3 and does not change the
33-
interface of the current Python binding).
29+
not recommended.
30+
31+
So Cython is not good together with PyPy which works best with a
32+
[CFFI](https://cffi.readthedocs.io/) binding. @Duality4Y did an experiment here
33+
https://github.com/Duality4Y/rgb-matrix-cffi which works well with PyPy and is
34+
about twice as fast as running Python3+cython (but Python3+cffi is slower than
35+
Python3+cython, so we can't just replace everything with cffi).
36+
37+
Of course, it would be nice to have the fastest possible binding to all kinds
38+
of Python interpreters. If anyone wants to work on that, this would certainly
39+
be a welcome pull request.
3440

3541
Performance
3642
-----------

0 commit comments

Comments
 (0)