]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-45530: speed listobject.c's unsafe_tuple_compare() (GH-29076)
authorTim Peters <tim.peters@gmail.com>
Mon, 25 Oct 2021 03:27:24 +0000 (22:27 -0500)
committerGitHub <noreply@github.com>
Mon, 25 Oct 2021 03:27:24 +0000 (22:27 -0500)
commit51ed2c56a1852cd6b09c85ba81312dc9782772ce
tree8d6cbd4b4a443e5be911579b6ff9f2d49ee65711
parent07236d562e59c6650227be18fa6ffc66b18d4741
bpo-45530: speed listobject.c's unsafe_tuple_compare() (GH-29076)

Keep track of whether unsafe_tuple_compare() calls are resolved by the very
first tuple elements, and adjust strategy accordingly. This can significantly
cut the number of calls made to the full-blown PyObject_RichCompareBool(),
and especially when duplicates are rare.

Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Doc/reference/expressions.rst
Doc/whatsnew/3.11.rst
Misc/NEWS.d/next/Core and Builtins/2021-10-20-01-28-26.bpo-45530.5r7n4m.rst [new file with mode: 0644]
Objects/listobject.c