Performance of int/long in Python 3

Terry Jan Reedy tjreedy at udel.edu
Wed Apr 3 02:19:46 EDT 2013


On 4/3/2013 1:32 AM, Steven D'Aprano wrote:
> On Wed, 03 Apr 2013 14:31:03 +1100, Neil Hodgson wrote:
>
>>      Sorting a million string list (all the file paths on a particular
>> computer) went from 0.4 seconds with Python 3.2 to 0.78 with 3.3 so
>> we're out of the 'not noticeable by humans' range. Perhaps this is still
>> a 'micro-benchmark' - I'd just like to avoid adding email access to get
>> this over the threshold.

What system *and* what compiler and compiler options. Unless 3.2 and 3.3 
are both compiler with the same compiler and settings, we do not know 
the source of the difference.

> I cannot confirm this performance regression. On my laptop (Debian Linux,
> not Windows), I can sort a million file names in approximately 1.2
> seconds in both Python 3.2 and 3.3. There is no meaningful difference in
> speed between the two versions.

I am guessing that Neil's undisclosed system (that I can see) is 
Windows, since other benchmarks have been more different on Windows than 
on *nix. Given that we *know* that the 3.2 and 3.3 distribution are 
compiled with different compilers and run with different C runtimes, it 
is possible that some of the difference is from that and not from python 
at all.

tjr






More information about the Python-list mailing list