Performance of int/long in Python 3

Chris Angelico rosuav at gmail.com
Wed Apr 3 02:25:37 EDT 2013


On Wed, Apr 3, 2013 at 4:32 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> 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.
>
> 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'd be curious to know the sorts of characters used. Given that it's
probably a narrow-vs-wide Python difference we're talking here, the
actual distribution of codepoints may well make a difference.

ChrisA



More information about the Python-list mailing list