mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
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>
This commit is contained in:
parent
07236d562e
commit
51ed2c56a1
4 changed files with 81 additions and 13 deletions
|
|
@ -1424,6 +1424,8 @@ Note that ``a op1 b op2 c`` doesn't imply any kind of comparison between *a* and
|
|||
*c*, so that, e.g., ``x < y > z`` is perfectly legal (though perhaps not
|
||||
pretty).
|
||||
|
||||
.. _expressions-value-comparisons:
|
||||
|
||||
Value comparisons
|
||||
-----------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue