Lazy-loading as an optimization possibility!!!
NOTE:For system specs see here
Use Lazy_Loader for import of modules during “startup”, so as to prevent import of module which are not necessary and explore the possibility of possible decrease in startup time.
What is lazy-loading?
What lazy-loading does is that, it loads a module only when it’s attributes are acccessed.This could be very important for applications that import a hell lot of stuff at start and thus could help lower their startup time.
Following links describe the status of imports in python presently:
And following for lazy-loading:
- Proposal of
lazy importkeyword here
LazyLoaderclass for creating “lazy” instances here
Effect on startup time
Following two possibilties were to be explored:- 1) If lazy-loading could actually be done so as to decrease the “startup time” by restricting import only to modules whose attributes are actually acccessed. 2) There might be some implicit imports which do not come up, so atleast detect them.