-
Notifications
You must be signed in to change notification settings - Fork 533
MAINT: Delayed imports to reduce import time #2809
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
Conversation
@oesteban Would you be interested in running your fingerprinting on this branch, to see how much effect this has? That will help determine if it's worth going further. |
Sure |
Auto-loading requests will go away with the next duecredit release including duecredit/duecredit#140, making duecredit a much lighter import |
Not a big dent
|
Codecov Report
@@ Coverage Diff @@
## master #2809 +/- ##
==========================================
- Coverage 67.51% 67.48% -0.03%
==========================================
Files 341 341
Lines 43316 43331 +15
Branches 5372 5371 -1
==========================================
Hits 29244 29244
- Misses 13372 13388 +16
+ Partials 700 699 -1
Continue to review full report at Codecov.
|
I guess this need to come accompanied by similar actions on fmriprep. BTW, I also used current master of duecredit. |
It's not really the import of niworkflows/fmriprep that's getting us.
|
b956d51
to
a073580
Compare
a073580
to
01f11b8
Compare
I don't know if this is the only impediment, but we can't confine numpy at all, due to the existence of the |
So it's not looking like this is going to save us a bunch of memory at run time, but at least it can make startup a little snappier. Merge, if you think it's useful. |
I'd like to merge this... the load time of nipype is starting to grate in other contexts. If anybody has time to review this, I'd appreciate a second set of eyes. I just looked through again and caught a couple things. |
1.1.7 (December 17, 2018) * FIX: Copy node list before generating a flat graph (nipy#2828) * FIX: Update pytest req'd version to 3.6 (nipy#2827) * FIX: Set ResourceMonitor.fname to an absolute path (nipy#2824) * FIX: Order of SPM.NewSegment channel_info boolean tuple is (Field, Corrected) (nipy#2817) * FIX: Indices were swapped for memory and cpu profile data (nipy#2816) * FIX: ``status_callback`` not called with ``stop_on_first_crash`` (nipy#2810) * FIX: Change undefined ScriptError on LFS plugin to IOError (nipy#2803) * ENH: Add NaN failure mode to CompCor interfaces (nipy#2819) * ENH: Enable cnr_maps and residuals outputs for FSL eddy (nipy#2750) * ENH: Improve ``str2bool`` + doctests (nipy#2807) * TST: Improve py.test configuration of doctests (nipy#2802) * DOC: Update DOI badge to point to all versions (nipy#2804) * MAINT: Offload interfaces with help formatting (nipy#2797) * MAINT: Reduce minimal code redundancy in filemanip.get_dependencies (nipy#2782) * MAINT: Delayed imports to reduce import time (nipy#2809) ...
Summary
This eliminates the import-time loading of:
Some possibly profitable additional excisions:
This reduces the profile to:
Related: #2776.
List of changes proposed in this PR (pull-request)
Acknowledgment