Slashdot Mirror


Project Aims For 5x Increase In Python Performance

cocoanaut writes "A new project launched by Google's Python engineers could make the popular programming language five times faster. The project, which is called Unladen Swallow, seeks to replace the Python interpreter's virtual machine with a new just-in-time (JIT) compilation engine that is built on LLVM. The first milestone release, which was announced at PyCon, already offers a 15-25% performance increase over the standard CPython implementation. The source code is available from the Google Code web site."

10 of 234 comments (clear)

  1. Speed ups for EVE online, perhaps? by KnightElite · · Score: 5, Insightful

    I hope this translates into further speed ups for EVE online down the road.

    1. Re:Speed ups for EVE online, perhaps? by idlemachine · · Score: 5, Informative

      I believe EVE uses Stackless Python. I'm not sure how well these improvements would translate across.

  2. Kill the GIL! by GlobalEcho · · Score: 5, Informative

    The summary misses one of the best bits -- the project will try to get rid of the Global Interpreter Lock that interferes so much with multithreading.

    Also, it's based on v2.6, which they are hoping will make 3.x an easy change.

  3. How fast is five times faster really? by LingNoi · · Score: 5, Funny

    They say five times faster however it really depends on if they're talking about a European or African Python Interpreter.

    1. Re:How fast is five times faster really? by meringuoid · · Score: 5, Funny

      Joking aside, though, I find this target to be overambitious. Speeding up by a factor of three would be plausible; two would be OK, but I'd hope they'd keep working on it to get it up to three. Four strikes me as unlikely, and five is right out.

      --
      Real Daleks don't climb stairs - they level the building.
  4. This is a very interesting project by Max+Romantschuk · · Score: 5, Interesting

    I read about what they intend to do, and they seem to have quite a few interesting ideas... But there are also major drawbacks:

    - No Windows support (apparently a Linux-only VM in the plans)
    - No Python 3.0 support

    And thus no guarantees most of the work will merge back into CPython.

    But competition is good, I can't really see a problem with having an alternative faster Python runtime, even if it's not as compatible as CPython. :)

    --
    .: Max Romantschuk :: http://max.romantschuk.fi/
  5. Re:Unladen Swallow by davester666 · · Score: 5, Funny

    It would still be huge! :-)

    --
    Sleep your way to a whiter smile...date a dentist!
  6. slowed it down by half? by Anonymous Coward · · Score: 5, Funny

    0.5x slower is like 2x faster, right? Reciprocals?

  7. Binspam by Thelasko · · Score: 5, Funny

    I get emails claiming to increase my python's performance all of the time, I just delete them.

    --
    One of our competitors trademarked the term "hypothesis". From now on, we will call them "boneheaded ideas".
  8. It all depends by mkcmkc · · Score: 5, Insightful

    I find Python is about 20x slower (and about 10x faster to implement) than C, with the number varying quite a bit depending on how CPU-bound the code is. Given the speed of modern processors, this is plenty fast for many tasks.

    Beyond that, many Python programmers employ a strategy of writing just the CPU-intensive inner loops in C or C++. This gives you most of the speed of an all-compiled solution but with much of the easier programming (and shorter programs) of the all-Python approach.

    My particular scientific application runs on 1500 cores, is about 75% Python/25% C++, is 4-5x smaller than similar all-C/C++ programs, and runs at about 95-99.99% of the speed of an all C++ solution.

    (Somewhat ironically, some of the worst performance bottlenecks in this app had to do with the overhead of some of the STL containers, which I ended up having to replace with C-style arrays, etc. to get best performance.)

    Not all apps will fall out this way, but you definitely can't assume that just because something's written in Python that it will be slow.

    (Going beyond that, we all know that better algorithms usually trump all of this anyway. If writing in Python gives you the time and clarity to be able to use an O(n)-better algorithm, that may pay off in itself.)

    --
    "Not an actor, but he plays one on TV."