3 Antworten
+ 3
Certain methods are slower or faster in python 3 due to the difference in implementation compared with python 2, but overall from reading about the differences in various sources it seems like python 3 is actually slower overall.
+ 2
which would you prefer?
0
Yes, and no.
It's faster in some areas, but the main reason for the performance impact is the implementation of the 'int' type. Python 3 is using something called arbitrary-sized integer type, where as in python 2 this is known as 'long'.
Convenience for programmers (high levels of abstraction) makes our lives easier, the consequence for this was a performance impact.
That being said, the change was also beneficial as well. If you use long integers, python 3.x is actually faster than python 2.x. As to the details in the background as to why that is - it's beyond my ability to explain that.