Z
Zac Burns
The section of code below, which simply gets the __file__ attribute of
the imported modules, takes more than 1/3 of the total startup time.
Given that many modules are complicated and even have dynamic
population this figure seems very high to me. it would seem very high
if one just considered the time it would take to load the pyc files
off the disk vs... whatever happens when module.__file__ happens.
The calculation appears to be cached though, so a subsequent check
does not take very long.
takes 0.5sec. Total module count is ~800.
Python version is 2.5.1
Code:
################################
for module in sys.modules:
try:
path = module.__file__
except (AttributeError, ImportError):
return
################################
--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games
the imported modules, takes more than 1/3 of the total startup time.
Given that many modules are complicated and even have dynamic
population this figure seems very high to me. it would seem very high
if one just considered the time it would take to load the pyc files
off the disk vs... whatever happens when module.__file__ happens.
The calculation appears to be cached though, so a subsequent check
does not take very long.
imports occur and this section executes takes 1.3sec. This sectionFrom once python starts and loads the main module to after all the
takes 0.5sec. Total module count is ~800.
Python version is 2.5.1
Code:
################################
for module in sys.modules:
try:
path = module.__file__
except (AttributeError, ImportError):
return
################################
--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games