4 ms·
The problem with this and all other efforts for speed in CPython is the interop with C extensions. For JITted Python look at PyPy, sure the JIT gives you some p
by dna_polymerase 6y ago
The problem with this and all other efforts for speed in CPython is the interop with C extensions. For JITted Python look at PyPy, sure the JIT gives you some performance, but they broke all C extensions along the way.
- heavenlyblue 6y ago> they broke all C extensions along the way. It doesn't have to be this way though?
- ploxiln 6y agoMany C extensions work with PyPy now. I have a service that uses pylibmc and pycurl, and it works with PyPy. Those extensions didn't rewrite with cffi or anything like that, PyPy added a compatibility layer, it's impressive. But, you don't get the JIT performance if you use the C extensions a lot, it's better for PyPy performance if you find a pure-python alternative for extensions used in "hot paths".
- chrisseaton 6y agoThe TruffleRuby approach is to run the C extensions in an interpreter with a JIT. This way you can change the C extension interface without changing the code, and the optimisations apply to both at the same time. https://www.youtube.com/watch?v=YLtjkP9bD_U https://www.youtube.com/watch?v=YLtjkP9bD_U
- MaxBarraclough 6y agoShouldn't a well-designed C extension interface work fine regardless of whether a JIT is used? Java's JNI interface, for instance, works fine with or without a JIT. Is it just that the interface was designed without JIT in mind?
- chrisseaton 6y ago> Shouldn't a well-designed C extension interface work fine... Yes! But we aren't working with one of those.