Skip to content

PERF: any/all with axis=1 #44857

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

Merged
merged 6 commits into from
Dec 16, 2021
Merged

PERF: any/all with axis=1 #44857

merged 6 commits into from
Dec 16, 2021

Conversation

jbrockmendel
Copy link
Member

from asv_bench.benchmarks.frame_methods import *
self = Dropna()
self.setup("any", 0)

%timeit self.time_dropna_axis_mixed_dtypes("any", 0)
23.6 ms ± 524 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- master
10.3 ms ± 190 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)  # <- PR

and len(self._mgr.arrays) > 1
and bool_only is not None
):
# Try to avoid a potentially-expensive transpose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you throw here on down into a function and call it. (i now it has to be on self) but maybe _reduce_maybe_without_transpose or _reduce_fast or similar

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. will need to do this to eventually extend this to sum and prod too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(xref #44793)

@jreback jreback added Performance Memory or execution speed performance Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Dec 14, 2021
@jreback jreback added this to the 1.4 milestone Dec 14, 2021
@jbrockmendel
Copy link
Member Author

updated+greenish (CI failure is codecov)

@jreback jreback merged commit 28f4942 into pandas-dev:master Dec 16, 2021
@jbrockmendel jbrockmendel deleted the perf-axis1 branch December 16, 2021 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants