-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: call ensure_wrapped_if_datetimelike before the array arithmetic_op #39820
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
REF: call ensure_wrapped_if_datetimelike before the array arithmetic_op #39820
Conversation
Any idea how big the perf impact is (both AM and non-AM)? needs to be worth the added complexity Could trim down some of this by making DatetimeBlock/TimedeltaBlock backed directly by DTA/TDA |
I am currently profiling So it's certainly not worth it on its own. But I think if we want to get the columnar frame ops closer to the blockwise ops (in performance), it will be thanks to multiple few-percentage improvements. The main complication here is that I needed to basically re-implement BlockManager.apply to be able to call To also repeat from above: an alternative is to have a variant of |
ive got a branch just about ready. The sticking point ATM is arrow tests which I'll email you about shortly.
sounds promising |
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
bd50388
to
89c375e
Compare
@jbrockmendel any further comments 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.
LGTM
A lot has changed since the OP. Any updated estimates on perf impact?
Eg in the |
thanks @jorisvandenbossche |
This is on top of #39772, so only the last commit needs to be looked at for now: bd50388The actual goal here is to have a version of
array_ops.py::arithmetic_op
that does not callensure_wrapped_if_datetimelike
on its arrays. Reason: when performing ops column-wise, this becomes unnecessary overhead, and so the goal is to ensure this on a higher level, before calling thearray_op
.So the experiment in this PR is to actually remove
ensure_wrapped_if_datetimelike
fromarithmetic_op
, and then add it in the places that will callarithmetic_op
, to see how much changes this needs. This would ensure that we can keep a single sharedarithmetic_op
for use by both ArrayManager and BlockManager. The alternative would be to make a variant ofarithmetic_op
without theensure_wrapped_if_datetimelike
. That would require fewer code changes, but would give some duplication aroundarithmetic_op
content (but it's not that it is a long function). Thoughts on which approach to prefer?cc @jbrockmendel