]> granicus.if.org Git - python/commit
Simple but important optimization for descr_check(): instead of the
authorGuido van Rossum <guido@python.org>
Mon, 19 Aug 2002 16:02:33 +0000 (16:02 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 19 Aug 2002 16:02:33 +0000 (16:02 +0000)
commitc588e9041aea212fe2b5fad9254824d12f804c3e
tree751766986c00b71afdedcca0664f0890d08e62c9
parentf2f2a2c130fc41bc854f376e13f4d6193a2b8b02
Simple but important optimization for descr_check(): instead of the
expensive and overly general PyObject_IsInstance(), call
PyObject_TypeCheck() which is a macro that often avoids a call, and if
it does make a call, calls the much more efficient PyType_IsSubtype().
This saved 6% on a benchmark for slot lookups.
Objects/descrobject.c