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

Skip Montanaro skip at pobox.com
Wed Apr 3 07:14:14 EST 2002


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

Have you tried weave?  It's part of SciPy.  From the SciPy front page:

    Weave 0.2.1 Now Available: weave is a new package that provides tools
    for including C/C++ code within Python code.  The weave.inline()
    function executes C code directly within Python, weave.blitz()
    translates Python Numeric expressions to C++ for fast execution...

More info is here:

    http://www.scipy.org/

-- 
Skip Montanaro (skip at pobox.com - http://www.mojam.com/)




More information about the Python-list mailing list