A faster Python?, Python compiler, Dylan,...

Jan Kybic kybic at ieee.org
Wed Apr 3 06:03:20 EST 2002


Hello,
        this is a post in favour of a faster Python:


> Or are there any hints that Numric is really way slower than Matlab?

In my field (signal and image processing) and on high-level tasks,
Python+Numeric runs at the same speed as the equivalent Matlab code.
I have one big application that I basically wrote twice for both
platforms and that's the conclusion I made.

On the other hand, all the calculation that you cannot express using
high-level primitives (using matrices, vectors,...) and has to be
performed with loops element by element, is painfully slow. Equally
slow in Python, as in IDL, Matlab,... It is so slow that it is
unusable, it is very difficult to develop an algorithm if it takes
days to process any reasonably sized input. My solution is to rewrite
the critical part of the code in C/C++, I did this for Matlab,
Python+Numeric, as well as IDL, but this is awkward - it forces you to 
work simultaneously with two languages and to deal besides the algorithm
itself with a lot of implementation and interface details.

In fact, it has become such a burden, that I am seriously considering
switching to another language. The only problem is that I still have
not found anything high-level, elegant, fast, and free at the same time.

It would be so much easier if I could just compile parts of the Python
code into the machine code. This would enable to use Python both for
the prototyping and for the production code.

One poster said that a true Python compiler is not feasible due to
Python's dynamic nature. My reponse to this is that I am quite willing 
to add (optional) typing information on variables to assist the
compiler to generate an efficient code. I have recently came across
the language Dylan which permits just that. I think this is a feasible
way of improving the Python performance.

I would love to hear your thoughts on the subject. 

Jan



-- 
-------------------------------------------------------------------------
Jan Kybic <kybic at ieee.org>      Robotvis, INRIA, Sophia-Antipolis, France
       or <Jan.Kybic at sophia.inria.fr>,tel. work +33 492 38 7589, fax 7845
                    http://www-sop.inria.fr/robotvis/personnel/Jan.Kybic/



More information about the Python-list mailing list