Open bryan-harter opened 5 years ago
This is a bit of code I was using to benchmark the times.
If you can pin point any bottlenecks I am sure astropy would be very happy to help out with removing them :smile:
Is this the reason why cdflib/__init__.py
imports CDFAstropy
as cdfastropy
?
This makes unixtime()
much slower again in pyspedas.
I now found the problem is actually on pyspedas side.
cdf_to_tplot
used in pyspedas/mms is somehow not the one in pytplot.
While each epoch class uses the same functions, Astropy can be much slower. It is faster for getting the unixtime and encode functions, but it is MUCH slower for the compute and parse functions.
Generally this seems to be stemming from the time it takes to convert an astropy time object to the cdf format, so for example:
Time(1000, format='unix').cdf_tt2000
takes up a lot of time.
We should figure out where the slowdown is happening in astropy, and determine if there is something we can do to speed it up. If not, we should just default to utilizing the functions in the primary CDFepoch module.