serge-ss-paille
Joined 10 years ago
Karma
163
Submissions
25
Member since
Mar 31
Joined 10 years ago
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.
Some benchmarks here: http://serge-sans-paille.github.io/pythran-stories/testing-p...
Some more benchmark you can run on you own: https://github.com/serge-sans-paille/numpy-benchmarks/
A comparison with Julia and native code: http://serge-sans-paille.github.io/pythran-stories/micro-ben...