Another thing I noticed is that homebrew python was noticeably slower on M2 comparing to the pyenv one. I imagine homebrew compiles it with too generic flags to support wide range of macs.
A comment in Homebrew's formula says that Homebrew adds the --enable-optimizations flag during compilation because Homebrew has separate binaries whereas the official Python release doesn't add this flag because "they want one build that will work across many macOS releases"
shpx|2 years ago
https://github.com/Homebrew/homebrew-core/blob/c1321e2629203...
A comment in Homebrew's formula says that Homebrew adds the --enable-optimizations flag during compilation because Homebrew has separate binaries whereas the official Python release doesn't add this flag because "they want one build that will work across many macOS releases"
https://github.com/Homebrew/homebrew-core/blob/c1321e2629203...
and it looks to me that pyenv just installs the official binary
https://github.com/pyenv/pyenv/blob/28e7000b485bff61235d8a69...
So I would expect it to be the other way around, Homebrew's Python should be faster.