[Python-Dev] explanations for more pybench slowdowns

Tim Peters tim.one@home.com
Sun, 20 May 2001 09:09:50 -0400


[Jeremy Hylton]
> ...
> The scary thing about BuiltinFunctinoCalls is that the profiler shows
> it spending almost 30% of its time in PyArg_ParseTuple().  It
> certainly is a shame that we have this complicated, slow run-time
> parsing mechanism to deal with a static property of the code, namely
> how many arguments it takes and whether their types are.

Special-casing the snot out of "O" looks like a winner <wink>:

  count     format %total  cumulative%
-------   -------- ------  -----------
1440897        'O'  47.45  47.45
 327694       'O!'  10.79  58.24
 285570      'O|i'   9.40  67.65
 262168     'O!|O'   8.63  76.28
 227405        'l'   7.49  83.77
 146537       's#'   4.83  88.60
  76779     'OO|O'   2.53  91.12
  65682      '|ss'   2.16  93.29
  48033       'OO'   1.58  94.87
  39879   'O|O&O&'   1.31  96.18

Those are the top 10 formats passed to PyArg_ParseTuple() during the test
suite, after stripping ";" and ":" decorations.

fast-paths-on-the-overtired-brain-ly y'rs  - tim