You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Repeating my comment on #74472: If we are touching min() and max(), it would make sense, IMO, to port them to Argument Clinic. FTR, Argument Clinic got *args support in #62809 / bpo-20291.
@colorfulappl made a "competing" branch using AC on his local fork1. However, that branch contained a bug with the key function; I made an amended version2 for benchmarking. Here's some micro-benchmarks from optimised builds on macOS 12.1 w/Clang 13:
Kind of like what's mentioned at faster-cpython/ideas#131 , it may be interesting to explore implementing min()/max() in Pure python, considering recent specializations to COMPARE_OP, and potential future specializations of FOR_ITER.
Activity
colorfulappl commentedon Dec 29, 2021
faster-cpython/ideas#199
erlend-aasland commentedon Dec 30, 2021
Repeating my comment on #74472: If we are touching
min()andmax(), it would make sense, IMO, to port them to Argument Clinic. FTR, Argument Clinic got*argssupport in #62809 / bpo-20291.@colorfulappl made a "competing" branch using AC on his local fork1. However, that branch contained a bug with the key function; I made an amended version2 for benchmarking. Here's some micro-benchmarks from optimised builds on macOS 12.1 w/Clang 13:
Footnotes
https://github.com/colorfulappl/cpython/commit/29b9559de31ae19e8d127d7a3063494b2d9791b0 ↩
https://github.com/erlend-aasland/cpython/tree/gh-30286-ac ↩
sweeneyde commentedon Dec 31, 2021
Kind of like what's mentioned at faster-cpython/ideas#131 , it may be interesting to explore implementing min()/max() in Pure python, considering recent specializations to COMPARE_OP, and potential future specializations of FOR_ITER.
arhadthedev commentedon Feb 26, 2023
@erlend-aasland Would you mind to publish https://github.com/erlend-aasland/cpython/tree/gh-30286-ac you mentioned as a PR, please? It will be a great opportunity to close gh-30286 and resolve this issue for good.
gh-90350: Optimize builtin functions min() and max() (GH-30286)
serhiy-storchaka commentedon Dec 11, 2023
Thank you for your contribution @colorfulappl.
Backport gh-90350: Optimize builtin functions min() and max() (GH-30286)
pythongh-90350: Optimize builtin functions min() and max() (pythonGH-…
pythongh-90350: Optimize builtin functions min() and max() (pythonGH-…