-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speedup package import time #319
Speedup package import time #319
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v1.4.2 #319 +/- ##
=======================================
Coverage 97.44% 97.44%
=======================================
Files 208 209 +1
Lines 23728 23746 +18
=======================================
+ Hits 23122 23140 +18
Misses 606 606
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hi @danielhollas – thanks for the PR I'm not sure about this change, given the (admittedly small) increase in complexity for a saving of O(ms) in a package that tends to execute (with external QM calculations) in O(h) |
Hi Tom, thanks for your comment. I agree that the change in timing is small in comparison to the cost of QM computations, however, sometimes we import autode when we do debugging in interactive mode and the import time is noticeable. This is also what motivated this change in the first place. We also noticed that importing autode slows down the import of mlptrain. We are planning to update the version of autode in mlptrain soon and I think it would be good if this update also increases the import speed. |
I'm not sure you'll notice a 0.1s change. Nevertheless, I don't think the overhead of remembering to import
|
Done.
Happy to contribute a test that will check that matplotlib is not loaded after |
Yes please 👍🏼 |
@t-young31 I've added a test and verified that it fails on the main branch and passes here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
We've been looking at the import time of the mlptrain package, which takes over a second on the cluster, and around 620ms on my dev machine with NVMe drive. Importing
autode
by itself takes 465 ms on main branch.One of the easy wins is to import
matplotlib
only when needed, which saves around 160 ms.Other potential improvements would come from delayed import of scipy and / or RDkit. But those would require more changes --- happy to open a separate PR if that is desired.
Corresponding PR on
mlptrain
repo: duartegroup/mlp-train#84