-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
PERF: regression in DataFrame reduction ops performance #37081 #37118
Conversation
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.
do we have an asv that covers this case, if not can you add one?
this doesn't need a note as its on master.
I believe we do : https://pandas.pydata.org/speed/pandas/#stat_ops.FrameOps.time_op?p-op='sum'&p-dtype='int' |
Indeed. Jeff, see the issue, it was actually catched thanks to our asv suite |
any_object = np.array( | ||
[is_object_dtype(values.dtype) for values in self._iter_column_arrays()], | ||
dtype=bool, | ||
).any() |
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.
let's only find the dtypes once (i.e. share with dtype_is_dt above
own_dtypes = [arr.dtype for arr in self._iter_column_arrays()]
# or
own_dtypes = [blk.dtype for blk in self._mgr.blocks]
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.
done in 41827fb
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.
Thanks @ukarroum, looks good!
Should i do something about the : 2 failed azure pipelines ? |
thanks @ukarroum |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Made the change proposed by @jorisvandenbossche in #35881 (comment)
Did a very quick comparison :
With
self.dtypes
(old version) :With
self._iter_column_arrays()
(new version) :