[Python-Dev] Autoloading? (Making Queue.Queue easier to use)
fredrik at pythonware.com
Sat Oct 15 14:35:17 CEST 2005
Antoine Pitrou wrote:
> > unfortunately, this standard seem to result in generic "spamtools" modules
> > into which people throw everything that's even remotely related to "spam",
> > followed by complaints about bloat and performance from users, followed by
> > various more or less stupid attempts to implement lazy loading of hidden in-
> > ternal modules, followed by more complaints from users who no longer has
> > a clear view of what's really going on in there...
> BTW, what's the performance problem in importing unnecessary stuff
> (assuming pyc files are already generated) ?
larger modules can easily take 0.1-0.2 seconds to import (at least if they
use enough external dependencies). that may not be a lot of time in itself,
but it can result in several seconds extra startup time for a larger program.
importing unneeded modules also add to the process size, of course. you
don't need to import too many modules to gobble up a couple of megabytes...
More information about the Python-Dev