• Tim Peters's avatar
    Restore dicts' tp_compare slot, and change dict_richcompare to say it · 4fa58bfa
    Tim Peters yazdı
    doesn't know how to do LE, LT, GE, GT.  dict_richcompare can't do the
    latter any faster than dict_compare can.  More importantly, for
    cmp(dict1, dict2), Python *first* tries rich compares with EQ, LT, and
    GT one at a time, even if the tp_compare slot is defined, and
    dict_richcompare called dict_compare for the latter two because
    it couldn't do them itself.  The result was a lot of wasted calls to
    dict_compare.  Now dict_richcompare gives up at once the times Python
    calls it with LT and GT from try_rich_to_3way_compare(), and dict_compare
    is called only once (when Python gets around to trying the tp_compare
    slot).
    Continued mystery:  despite that this cut the number of calls to
    dict_compare approximately in half in test_mutants.py, the latter still
    runs amazingly slowly.  Running under the debugger doesn't show excessive
    activity in the dict comparison code anymore, so I'm guessing the culprit
    is somewhere else -- but where?  Perhaps in the element (key/value)
    comparison code?  We clearly spend a lot of time figuring out how to
    compare things.
    4fa58bfa
Adı
Son kayıt (commit)
Son güncelleme
..
.cvsignore Loading commit data...
abstract.c Loading commit data...
bufferobject.c Loading commit data...
cellobject.c Loading commit data...
classobject.c Loading commit data...
cobject.c Loading commit data...
complexobject.c Loading commit data...
dictobject.c Loading commit data...
fileobject.c Loading commit data...
floatobject.c Loading commit data...
frameobject.c Loading commit data...
funcobject.c Loading commit data...
intobject.c Loading commit data...
iterobject.c Loading commit data...
listobject.c Loading commit data...
longobject.c Loading commit data...
methodobject.c Loading commit data...
moduleobject.c Loading commit data...
object.c Loading commit data...
obmalloc.c Loading commit data...
rangeobject.c Loading commit data...
sliceobject.c Loading commit data...
stringobject.c Loading commit data...
tupleobject.c Loading commit data...
typeobject.c Loading commit data...
unicodectype.c Loading commit data...
unicodeobject.c Loading commit data...
unicodetype_db.h Loading commit data...
xxobject.c Loading commit data...