[issue1479611] speed up function calls

Antoine Pitrou report at bugs.python.org
Mon Jan 14 00:23:49 CET 2008


Antoine Pitrou added the comment:

Here is a patch applicable for SVN trunk.
However, as Bob I have mixed results on this. For example, functions
with variable parameter count have become slower:

# With patch
$ ./python -m timeit -s "def f(*x): pass" 'for x in xrange(10000): f(1)'
100 loops, best of 3: 4.92 msec per loop
$ ./python -m timeit -s "def f(*x): pass" 'for x in xrange(10000): f()'
100 loops, best of 3: 4.07 msec per loop
$ ./python -m timeit -s "def f(*x): pass" 'for x in xrange(10000): f(1,2)'
100 loops, best of 3: 5.04 msec per loop

# Without patch
$ ./python-orig -m timeit -s "def f(*x): pass" 'for x in xrange(10000):
f(1)'
100 loops, best of 3: 4.22 msec per loop
$ ./python-orig -m timeit -s "def f(*x): pass" 'for x in xrange(10000): f()'
100 loops, best of 3: 3.5 msec per loop
$ ./python-orig -m timeit -s "def f(*x): pass" 'for x in xrange(10000):
f(1,2)'
100 loops, best of 3: 4.46 msec per loop

----------
nosy: +pitrou
Added file: http://bugs.python.org/file9154/funcall.patch

_____________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1479611>
_____________________________________


More information about the Python-bugs-list mailing list