PERF: reverted change from commit 7d257c69 to solve issue  #37081
reverted change from commit 7d257c697 to solve issue  #37081

- [x] closes #37081
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Is it the check itself (e.g evaluating `self._mgr.any_extension_types`) that is causing the slowdown?

If this is reverted, everything else in the referenced commit can be reverted along with it. > Is it the check itself (e.g evaluating `self._mgr.any_extension_types`) that is causing the slowdown?
> 
> If this is reverted, everything else in the referenced commit can be reverted along with it.

It's not the check, it's using `df._mgr.reduce` instead of `func(values)`, the added condition only make it visible by forcing the benchmark to use of df._mgr.reduce instead of func(values). If that's really the case for the other dtypes, then i guess we may have a deeper issue (only checked for numerical df which is the example used in the issue).

PS : Sorry for the late response had a rough week. > flake8 is failing pre-commit also you likely have to change some tests to get this to pass

`git diff upstream/master -u -- "*.py" | flake8 --diff` returns no error (in local)

`./ci/code_checks.sh` seems to run fine (no errors in local). see the error in the ci: https://github.com/pandas-dev/pandas/pull/37426/checks?check_run_id=1343971174 pls post the revised asv's as well > > flake8 is failing pre-commit also you likely have to change some tests to get this to pass
> 
> `git diff upstream/master -u -- "*.py" | flake8 --diff` returns no error (in local)

Unfortunately that doesn't catch all issues - from the contributing guide: "One caveat about git diff upstream/master -u -- "*.py" | flake8 --diff: this command will catch any stylistic errors in your changes specifically, but be beware it may not catch all of them. "

> `./ci/code_checks.sh` seems to run fine (no errors in local).

flake8 is no longer in there. If you enable pre-commit in your workspace (`pre-commit install`) it'll find these kinds of errors before you make your commit.

Or you can just run `flake8` from the command-line on the files you've changed.

Even better, you can run `pre-commit run flake8 --files <files you've changed>` (or `pre-commit run flake8 --all-files`) thanks @ukarroum 