weird thing of ClassLoader, it's so slow using __import__
I have encountered a weird thing in win2003.when we use ClassLoader to load cloudbaseinit.osutils.windows.WindowsUtils, sometime it takes more than 80 seconds. and it seems only happen in the first windows setup, when restart again, it just takes less than 1ms.
the code is here(it's the function of ClassLoader class):
def load_class(self, class_path):
LOG.debug('Loading class \'%s\'' % class_path)
parts = class_path.rsplit('.', 1)
# *the __import__ function takes more than 80 seconds in the first time*
module = __import__(parts[0], fromlist=parts[1])
return getattr(module, parts[1])
The whole source code is from CloudbaseInitSetupBetax86.msi installation. Up to now, i can't tell it's a python thing or a cloudbase-init thing, can someone explain it?? If you need more information, please tell me. thanks very much.
Are you using x86 or x64 images?
windows 2003 32bit system, it's x86