Pyhon 2.x or 3.x, which is faster?

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Mar 7 21:53:36 EST 2016


On 07/03/2016 11:38, BartC wrote:
> On 07/03/2016 11:11, Marko Rauhamaa wrote:
>> BartC <bc at freeuk.com>:
>>
>>> I've also found that 3 was consistently slower than 2 on various
>>> benchmarks. Perhaps 10 to 20% slower (also 3.4 vs. 2.7).
>>
>> Python doesn't exist for performance-critical parts of your solution.
>> Also, Python programs tend to take huge amounts of space.
>
> I'm not complaining. For my purposes (implementing a similar language
> that competes with Python for speed), I welcome the slower speed of
> Python 3!
>
> (Although competing with CPython is too easy. PyPy is more of a problem.
> With the Jpeg benchmark I mentioned, I can beat PyPy up to 6Mpix, but
> then PyPy starts to get faster. At 80Mpix, PyPy is 60% faster.)
>

I suspect that all that is happening is you are ignoring the Python 
startup time, so the more data you process, the better the figures will 
look for any version of Python.

As for the real world, as opposed to benchmarks, how about this 
https://www.willmcgugan.com/blog/tech/post/realtime-events-with-the-inthingio-python-api/ 
?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list