NWChemEx / .github

GitHub Settings for the NWChemEx Organization
https://nwchemex.github.io/.github/
Apache License 2.0
1 stars 2 forks source link

Import time #33

Closed ryanmrichard closed 11 months ago

ryanmrichard commented 2 years ago

On my computer the Python script:

import simde

takes about 7.5s to run. As far as I can tell, this overhead occurs every time I run the script. While not an issue on the scale of coupled-cluster it is somewhat annoying. For now I'm okay developing with a 7s overhead, so I wouldn't consider this a high priority issue.

This is a known issue, and I am simply creating this issue for the sake of generating a complete list of Python tasks. I'm not 100% sure what repo to put this issue in, i.e., I'm not sure if this is a problem with how we use Cppyy (in which case it should go in .github) or if there's something to be done on the SimDE side (and presumably on the side of other repos as well). IIRC the working hypothesis was this is an issue with how we use Cppyy so I put this issue in .github. We should move the issue as appropriate.

keceli commented 2 years ago

I don't have a solution, but I want to share some profiling info that can help us reduce the import time. Based on the profile on my laptop most of time is spent on the following:

These top 5 items take about 75% of the import time. I haven't profiled separately but I'd guess most of the time is spent in the header only external dependencies such as Eigen in diis.hpp and Cereal in archive_wrapper.hpp. I don't think we need the serialization functions for the Python API, so it might be easy to get rid of that one. I am not also sure if we need to include Eigen explicitly, but that might be more involved.

keceli commented 11 months ago

I'll close this issue since the focus shifted to PyBind11 bindings and import times are not significant anymore.