-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Performance regression in stat_ops.FrameMultiIndexOps.time_op #35186
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
Performance regression in stat_ops.FrameMultiIndexOps.time_op #35186
Conversation
post_processing=lambda vals, inference: np.sqrt(vals), | ||
ddof=ddof, | ||
) | ||
result = self.var(ddof=ddof) |
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.
hmm you are reverting.
instead I would like to see if the generic function can be patched (e.g. something is fundamentally different).
cc @rhshadrach
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.
I don't see a way. _get_cythonized_result
operates column-by-column, creating overhead. On data this size, we spend 25% in grouper.group_info
and 40% in _wrap_aggregated_output
. Within each of these operations, I don't see any easy wins. Only 27% of the time is spent doing the actual computation.
The only way I see to improve performance is to change _get_cythonized_result
to a 2d operation, operating on all columns at once. In the PR that caused this regression, that's the first thing I tried and found that it got too hairy. In the process, I realized that perhaps a better solution would be to incorporate the features of _get_cythonized_result
(namely, pre- and post-processing) into _cython_agg_general
.
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.
hmm you are reverting.
yep. should have mentioned this in the OP.
instead I would like to see if the generic function can be patched (e.g. something is fundamentally different).
OK. will close this for now. can reopen if a better solution is not forthcoming before the release.
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.
OK. will close this for now. can reopen if a better solution is not forthcoming before the release.
or maybe better would be to backport this after 1.1rc if not fixed before.
@jreback if we're not branching, should I reopen this and merge to master? see #34730 (comment) |
no reverting is not useful here |
If we're not reverting, the only three options I can see are:
I don't know how viable/difficult 3 would be, and I'd be happy to work on it, but I don't think we want it in 1.1.0 at this point even if it could get done. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff