108 points · by serge-ss-paille · 8y ago · 25 comments
The Julia language was designed to target the two language problem and at least from these benchmarks it looks pretty competitive [1]. I imagine over time, pythran may fix some limitations and beat Julia in most benchmarks.
[1] https://github.com/fluiddyn/BenchmarksPythonJuliaAndCo/tree/...
That said, I want to try Pythran to see how it works for one of my at-home side projects.
I had to learn a bit of Julia about 20 months ago - an old customer got in a pinch when somewhen left before a deliverable so I was immersed using Julia for two weeks. At first I liked the idea of Julia but I didn’t fall in love with the language.
Was there anything specific that turned you off from Julia?
Another issue is that it's not always that fast, for a recent project I never managed to exceed 100 MFLOPS, at which point I switched to C++ and got 3 GFLOPS. But the python version stalled out at 4 MFLOPS though...
Nuitka has fantastic Python 3 support (up to 3.7 currently).
Pythran main aim is to be fast, and to achieve this they're willing to only support a small subset of python.
As Nuitka's performance gets better and Pythran starts to support more and more of python, perhaps they'll converge at some point in the future.
It feels to me like Pythran + opencv would be a killer combination since it can take 300+ lines of C++ to achieve what you can with 40ish lines of numpy, opencv and python.
I see that you are involved with the Pythran project, so could you tell us the shortcomings of Cython? As I understand it, before Pythran didn't support Python 3, but seems like that has changed
In order to achieve top performance, in the context of numerical simulations, you generally end up explicity writing the loops are implicit in high-level numpy (less abstraction).
Cython does not perform any high-level optimisation on the code, while Pythran does. For instance Pytrhan computes whether an array index may be negative or not, and generates wraparound only when needed. On the otherhand Cython requires a compiler directive to do so.
That being said, Cython can do plenty of stuff Pythran cannot: import native libraries, wrap classes, mixed Python/native mode etc. It has a much stronger codebase (more tested/validated) and a larger community.