On Tue, Jul 28, 2009 at 8:02 PM, Greg Ewing<[email protected]> 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 _______________________________________________ Distutils-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/distutils-sig
