-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
aggregate_downsample(): much slower for non-Quantity columns #13093
Comments
So it has nothing to do with converting to |
No. The issue existed before By process of elimination, I think it's all the array slicing during astropy/astropy/timeseries/downsample.py Lines 27 to 29 in b17655f
|
Not sure I can follow. That case has always been converted to
But how would that behave differently, as it is called exactly the same way and with the same Interestingly for |
I tried a similar fix in PR #13069, but realized it might be too complicated to be bundled in that PR. |
I think it does not even have to be that complicated, since the check in astropy/astropy/timeseries/downsample.py Line 229 in a50ea29
values is an np.ndarray at that point (I just shuffled the cases a bit around in the PR hoping to make the logic clearer).Feel free to include either of the two options from #13126 in #13069, as it is more useful there anyway. |
Description
Timseries
aggregate_downsample()
: when it is downsampling a non-Quantity
columns (Column
,NdarrayMixin
), it is noticeably slower. We should make them comparable toQuantity
columns.In practice, it could affect columns such as cadence number.
The slow down:
Quantity
Column
NdarrayMixin
The numbers is based on Astropy 4.3.1. Astropy 5.0.4 also has similar slow down, but it has an additional performance regression in #13058 so astropy 4.3.1's number is used here.
Profile result shows that additional overhead is incurred by
Column
andNdarrayMixin
duringreduceat
operations, primarily in the__array_finalize__()
function of the repsective classes.Script to produce the numbers
Affected versions
The slow down is observed in
v4.3.1
andv5.0.4
, and probably affect earlier versions.The text was updated successfully, but these errors were encountered: