Lua is faster than Fortran???

Felix schlesin at cshl.edu
Fri Jul 9 09:25:58 EDT 2010


On Jul 9, 1:16 am, sturlamolden <sturlamol... at yahoo.no> wrote:
> On 9 Jul, 05:39, Felix <schle... at cshl.edu> wrote:
> > For an outsider it does not look like a solution to the GIL mess or a
> > true breakthrough for performance are around the corner (even though
> > there seem to be many different attempts at working around these
> > problems or helping with parts). Am I wrong?
>
> Yes you are.
>
> We don't do CPU intensive work in "pure Python". We use Python to
> control C and Fortran libraries. That gives us the opportunity to
> multi-thread in C, release the GIL and multi-thread in Python, or
> both.

Yes, this setup works very well and is (as I said) probably the reason
python is so widely used in scientific computing these days.
However I find that I can almost never do everything with vector
operations, but have to iterate over data structures at some point.
And here the combination of CPython slowness and the GIL means either
bad performance or having to write this in C (with which cython helps
fortunately). If it were possible to write simple, parallel,
reasonably fast loops in (some subset of) python directly that would
certainly be a great advantage. Given the performance of other JITs it
sounds like it should be possible, but maybe python is too complex to
make this realistic.

Felix

PS: No need to convince me that MATLAB is not the solution.



More information about the Python-list mailing list