[Python-Dev] Special-casing "O"

Jeremy Hylton jeremy@digicool.com
Sun, 27 May 2001 14:51:26 -0400 (EDT)


>>>>> "MvL" == Martin v Loewis <martin@loewis.home.cs.tu-berlin.de> writes:

  MvL> to the existing approach. The main point of this patch is to
  MvL> improve efficiency, and (according to Jeremy's analysis), most
  MvL> of the time for calling a function is spend in
  MvL> PyArg_ParseTuple.

I'd like to qualify this a bit.  What I reported earlier is that the
BuiltinFuntionCall microbenchmark in pybench spends 30% of its time in
PyArg_ParseTuple().  This strikes me as excessive, because it's a
static property of the code.  (One could imagine writing a Python
script that parsed the "O!|is#" format strings and generated
efficient, specialized C code for that format.)

If we benchmark other programs, particularly those that do more work
in the builtins, the relative cost of the argument processing will be
lower.

Jeremy