• Tim Peters's avatar
    docompare(): Use PyTuple_New instead of Py_BuildValue to build compare's · f2a04733
    Tim Peters yazdı
    arg tuple.  This was suggested on c.l.py but afraid I can't find the msg
    again for proper attribution.  For
    
        list.sort(cmp)
    
    where list is a list of random ints, and cmp is __builtin__.cmp, this
    yields an overall 50-60% speedup on my Win2K box.  Of course this is a
    best case, because the overhead of calling cmp relative to the cost of
    actually comparing two ints is at an extreme.  Nevertheless it's huge
    bang for the buck.  An additionak 20-30% can be bought by making the arg
    tuple an immortal static (avoiding all but "the first" PyTuple_New), but
    that's tricky to make correct since docompare needs to be reentrant.  So
    this picks the cherry and leaves the pits for Fred <wink>.
    
    Note that this makes no difference to the
    
        list.sort()
    
    case; an arg tuple gets built only if the user specifies an explicit
    sort function.
    f2a04733
Adı
Son kayıt (commit)
Son güncelleme
..
.cvsignore Loading commit data...
abstract.c Loading commit data...
boolobject.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...
descrobject.c Loading commit data...
dictobject.c Loading commit data...
enumobject.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...
structseq.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...
weakrefobject.c Loading commit data...
xxobject.c Loading commit data...