11 votes

You should compile your Python and here’s why

1 comment

  1. smores
    Link
    So I quite liked this post, but I think its conclusion is a little odd. The post makes several very strong claims about algorithmic optimization of Python, the value of Mypyc, and readability,...

    So I quite liked this post, but I think its conclusion is a little odd. The post makes several very strong claims about algorithmic optimization of Python, the value of Mypyc, and readability, but… the example it chooses at the end doesn’t really seem to back up those claims? As far as I can see, Mypyc only had moderate improvements on the naïve Python implementation’s performance (don’t get me wrong, I agree with the author; 25% speedup for free is very convincing!); the most significant performance improvement by far was due to optimizing the Python code by hand. I would argue that the result of this hand tuning is Python code that’s significantly less readable than the equivalent C code, by the way.

    It’s still very cool how much Mypyc can give you for free! Especially for server-side applications, where you have control over the runtime environment, this seems like a very, very low-cost source of performance improvements!

    4 votes