PERF: reductions
State: closed

Discussed on today's call

Labels:
name: Performance
description: Memory or execution speed performance

Comments:
forgot the ref issue, but this improves the relevant asvs's?
> forgot the ref issue, but this improves the relevant asvs's?

Based on the most-affected asv discussed on the call:

```
In [2]: ser = pd.Series([True] * 10**6)

In [3]: %timeit ser.all()
53.3 µs ± 1.85 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <-- PR
431 µs ± 7.61 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)  # <-- master

```
Sorry, I didn't see you opened a PR already (it could help to reference the original PR), and I also made one this morning: https://github.com/pandas-dev/pandas/pull/41920 

I think my fix might be a bit simpler, but didn't check in detail.
they are pretty similar. going to merge this one as its slightly more explict.
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
$ git checkout 1.2.x
$ git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
$ git cherry-pick -m1 c8e23d2bbb041235c021c96e9f5f8799e45a35e6
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
$ git commit -am 'Backport PR #41911: PERF: reductions'
```

4. Push to a named branch :

```
git push YOURFORK 1.2.x:auto-backport-of-pr-41911-on-1.2.x
```

5. Create a PR against branch 1.2.x, I would have named this PR:

> "Backport PR #41911 on branch 1.2.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
@meeseeksdev backport 1.2.x
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
$ git checkout 1.2.x
$ git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
$ git cherry-pick -m1 c8e23d2bbb041235c021c96e9f5f8799e45a35e6
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
$ git commit -am 'Backport PR #41911: PERF: reductions'
```

4. Push to a named branch :

```
git push YOURFORK 1.2.x:auto-backport-of-pr-41911-on-1.2.x
```

5. Create a PR against branch 1.2.x, I would have named this PR:

> "Backport PR #41911 on branch 1.2.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
Sorry Jeff, I don't really appreciate that (yes it was duplicate work, but I also did put time in this, then at least give some time to discuss what's the best approach), so I reverted this
And sorry for my over-reaction, I shouldn't have directly reverted the merge. I was just annoyed by the lack of time to respond, but I didn't need to revert it for that. 
I opened a new PR with Brock's change -> https://github.com/pandas-dev/pandas/pull/41924
@jorisvandenbossche this is a way over reaction 

brock's pr was first and is better

but you can handle now