[Patches] [ python-Patches-426072 ] special case "O" in PyArg_ParseTuple()

noreply@sourceforge.net noreply@sourceforge.net
Mon, 21 May 2001 14:29:49 -0700


Patches item #426072, was updated on 2001-05-21 14:29
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=426072&group_id=5470

Category: core (C code)
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Jeremy Hylton (jhylton)
Assigned to: Tim Peters (tim_one)
Summary: special case "O" in PyArg_ParseTuple()

Initial Comment:
The most common argument passed to PyArg_ParseTuple() 
is one or more Os. Special-case Os to make this go a
bit faster.

Also eliminate the convertsimple(), convertsimple1()
two-step, since it's adding an extra function call to
all cases to handle the error cases.  Instead, call the
extra function only when an error occurs.

Note that the indentation in this patch is a bit messy.

The speedup is modest.  On the parsetuple-intensive
benchmarks like pybench's BuiltinFunctionCalls, this
patch reduces the cost of PyArg_ParseTuple() by almost
40%.


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

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