This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients brett.cannon, eric.snow
Date 2013-08-29.17:58:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377799087.61.0.682390742234.issue18810@psf.upfronthosting.co.za>
In-reply-to
Content
I also just tried using os.listdir() for a package before searching for __init__ and it didn't speed anything up either (actually timeit suggests that os.listdir() is worse than an isdir + 3 * isfile checks). Nor did caching directory stuff at the class level so that they were shared when an os.listdir() was done for an __init__ so that didn't have to be done a second time if the cache wasn't stale already.

I have attached the patch with all of the changes to cut the number of stat calls down significantly, but benchmarking on my work machine shows no definitive benefit.
History
Date User Action Args
2013-08-29 17:58:07brett.cannonsetrecipients: + brett.cannon, eric.snow
2013-08-29 17:58:07brett.cannonsetmessageid: <1377799087.61.0.682390742234.issue18810@psf.upfronthosting.co.za>
2013-08-29 17:58:07brett.cannonlinkissue18810 messages
2013-08-29 17:58:07brett.cannoncreate