News for hackers. Stuff that matters.

serge-ss-paille

More materials for the curious:

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...

> could you tell us the shortcomings of Cython

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.

Re:Pythran: Crossing the Python Frontier [pdf] on Tuesday April 24, 2018 @08:32AM (#16911961)
(shameful author here)

One should read

  def rosen_explicit_loop(x): 
    s = 0. 
    n = x.shape[0] 
    for i in range(0, n - 1): 
      s += 100. * (x[i + 1] - x[i] ** 2.) ** 2. + (1 - x[i]) ** 2 
    return s
(edited)
Re:Pythran: Crossing the Python Frontier [pdf] on Tuesday April 24, 2018 @08:29AM (#16911947)
(main dev writting) Don't focus too much on the claimless :-) There still are far more wide spread tools that solve the same kind of issues (numba, cython, julia)...

The idea of the change was that it's more important to convey the problem it solves rather than how it's done ;-)