Closed link89 closed 2 months ago
I find that it would takes up to 30s to run just import dpdata on the login node of HPC. I did some investigation myself and find that it would load almost all the modules into memory when importing the dpdata module.
import dpdata
dpdata
Here is the relative code: https://github.com/deepmodeling/dpdata/blob/master/dpdata/__init__.py#L21-L30
Is it possible to just remove the __all__ expression? I think it is for users who like to use from dpdata import *, which is not a good practices IMO.
__all__
from dpdata import *
@link89 it will be helpful if you show the output of python -X importtime -c 'import dpdata' to let us know which module takes the longest time.
python -X importtime -c 'import dpdata'
log.txt Here is the log.
I find that it would takes up to 30s to run just
import dpdata
on the login node of HPC. I did some investigation myself and find that it would load almost all the modules into memory when importing thedpdata
module.Here is the relative code: https://github.com/deepmodeling/dpdata/blob/master/dpdata/__init__.py#L21-L30
Is it possible to just remove the
__all__
expression? I think it is for users who like to usefrom dpdata import *
, which is not a good practices IMO.