[Patches] [ python-Patches-517521 ] Optimization for PyObject_Get/SetAttr

noreply@sourceforge.net noreply@sourceforge.net
Thu, 14 Feb 2002 06:19:36 -0800


Patches item #517521, was opened at 2002-02-14 06:19
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=517521&group_id=5470

Category: Core (C code)
Group: Python 2.2.x
Status: Open
Resolution: None
Priority: 5
Submitted By: Greg Chapman (glchapman)
Assigned to: Nobody/Anonymous (nobody)
Summary: Optimization for PyObject_Get/SetAttr

Initial Comment:
The attached patch is based on the assumption that the 
vast majority of calls to PyObject_GetAttr and 
PyObject_SetAttr use a PyString (rather than a 
PyUnicode) as the name parameter.  Because these 
routines perform a PyUnicode_Check first, every call 
(with a PyString as name) requires a call to 
PyType_IsSubType.  By reorganizing so that 
PyString_Check is called first, the call to 
PyType_IsSubType is avoided in the common case.  The 
same reorganization is done for 
PyObject_GenericGet/SetAttr.



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=517521&group_id=5470