Closed philippjfr closed 5 years ago
After an initial look I don't think there's much we can do about numpy, pandas and probably scipy. I would however consider moving the iris extension into GeoViews, which will shave off about 700ms. We could also investigate why numba gets imported by default which could shave another 500ms off.
Just tested it without the iris data interface, which brings it down to 1549.9 ms vs. 3858.4 ms with it. I'd say we should definitely move it to GeoViews.
Sounds good.
I would also like to defer scipy imports to where they are needed, presumably in operations but not much else of holoviews needs scipy afaik.
Moving iris support does make sense; there surely will be very few users who want Iris without GeoViews. (Conversely, not sure if it's possible to copy WMTS from GeoViews to HV? Seems like that part wouldn't depend on the rest of GeoViews, as long as projections are left up to the user, and I think that's the part of GV people are mostly likely to want (and thus could have without having the other heavy dependencies of GV. But I digress. :-)
I always get confused by profiler output, but it seems to me to be saying that 0.6s is spent importing numpy. That's odd, because launching python and importing numpy by itself together take only 0.2s:
$ time python -c "import numpy ; print(numpy.__version__)"
1.13.1
0.186u 0.027s 0:00.21 95.2% 0+0k 0+0io 0pf+0w
Maybe it's importing specific things from numpy that is expensive, not numpy as a module?
So I've just had a go at this but the main issue that there is no way for me to move the tests into geoviews since they rely on baseclasses which are in the holoviews root directory. I think we should start moving tests into the modules they apply to rather than keeping them all separate. This is also the structure other projects like bokeh follow.
Just to clarify, this issue is "closed - done", not "closed - wontfix", despite the last comment above...
We have on occasion discussed how long it takes to import holoviews. After coming across the import_profiler library I just ran it so now we have something concrete to discuss, here's the output: