The speed of glob()

Gisle Vanem gisle.vanem at gmail.com
Wed Jul 29 05:43:06 EDT 2020


Chris Angelico wrote:

>> Has anybody noticed the speed of 'glob()' has
>> decreased somewhere between v3.6 and v3.10.
>>
>> I got these results:
>>     Python 3.6.5:
>>       1st run: 0.14694
>>       2nd run: 0.09506   <- *always* the fastest
>>     Python 3.7.7:        <- from Nuget
>>       1st run: 0.12440
>>       2nd run: 0.09602
>>     Python 3.10.0:       <- from Git repo
>>       1st run: 0.15922
>>       2nd run: 0.12424
>>
>> 'glob()' in Python 3.6.5 is consistently 30% faster on
>> the 2nd run compared to 3.10.0.
>>
> 
> Unfortunately that's very hard to compare. If you're building Python
> from source, the parameters may be VERY different from a prepackaged
> binary.

I guess so w/o knowing why. I just tried this from MS' AppStore:
Python 3.8.5:
   1st run: 0.12121
   2nd run: 0.07674

Fastest I've tried so far.

> Are you able to redo this test with more consistent Python builds? For
> instance, you can go as far as 3.8 using python.org binaries, or
> alternatively, build all your tests from git (by checking out
> different branches).

I do not want to put to much stress on this. Maybe I'm just 'ass-u-me'ing
too much?

The important thing is that any Python3.x is much faster on both
the 1st and 2nd run compared to my Python 2.7.

-- 
--gv


More information about the Python-list mailing list