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

BartC bc at freeuk.com
Tue Mar 8 06:15:36 EST 2016


On 08/03/2016 02:47, MRAB wrote:
> On 2016-03-08 01:33, BartC wrote:

>> Compared with 2.7, 3.4 above is spending nearly an extra ten seconds
>> doing .... what? I can't understand why someone just wouldn't care.
>>
> Part of it will be that Python 2 has 2 integer types: 'int' (fixed
> length) and 'long' (variable length).
>
> Originally, 'int' addition could overflow, but it was more friendly to
> promote the result to 'long' instead.

That was my first thought on reading the thread and was going to post 
that as the reason for 3 being a little more sluggish.

But then I tested Python 2 (2.7.11), and I couldn't get integer 
arithmetic to overflow at all!

-- 
Bartc



More information about the Python-list mailing list