[Distutils] Cache PYTHONPATH? (Re: make unzipped eggs be the default)

Ian Bicking ianb at colorstudy.com
Wed Jul 29 04:22:02 CEST 2009


On Tue, Jul 28, 2009 at 8:02 PM, Greg Ewing<greg.ewing at canterbury.ac.nz> wrote:
> P.J. Eby wrote:
>
>> So the optimum performance tradeoff depends on how many imports you have
>> *and* how many eggs you have on sys.path.  If you have lots of eggs and few
>> imports, unzipped ones will probably be faster.  If you have lots of eggs
>> and *lots* of imports, zipped ones will probably be faster.
>
> I'm wondering whether something could be gained by
> cacheing the results of sys.path lookups somehow
> between interpreter invocations.
>
> Most of the time the contents of the directories
> on one's PYTHONPATH don't change, so doing all this
> statting and directory reading every time an
> interpreter starts up seems rather suboptimal.

I can see how this could go quite wrong, but maybe if installers touch
some file in the library directory anytime a package is
installed/reinstalled/removed/etc, then it would be fast to check if
the cache was correct.  Though the optimization seems like its working
around something that maybe shouldn't be a problem.

-- 
Ian Bicking  |  http://blog.ianbicking.org  |  http://topplabs.org/civichacker


More information about the Distutils-SIG mailing list