[issue12953] Function calls missing from profiler output

Terry J. Reedy report at bugs.python.org
Fri Sep 16 18:46:49 CEST 2011


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Thanks for the report, which I verified on 3.2.2, Win7. When reporting a bug, please give a minimal example of code showing the bug, and the buggy output. I presume you mean something like the following (slightly edited):

>>> profile.run('for i in range(10): len({})')
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000 :0(exec)
       10    0.000    0.000    0.000    0.000 :0(len)
        1    0.016    0.016    0.016    0.016 :0(setprofile)
        1    0.000    0.000    0.000    0.000 <string>:1(<module>)
        1    0.000    0.000    0.016    0.016 profile:0(for i in range(10): len({}))
        0    0.000             0.000          profile:0(profiler)

>>> profile.run('for i in range(10): range(1)')
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000 :0(exec)
        1    0.000    0.000    0.000    0.000 :0(setprofile)
        1    0.000    0.000    0.000    0.000 <string>:1(<module>)
        1    0.000    0.000    0.000    0.000 profile:0(for i in range(10): range(1))
        0    0.000             0.000          profile:0(profiler)

The one call to range(10) and in the second case, the 10 calls to range(1) are missing while in the first case, the 10 calls to len(()) are reported. This looks like a bug to me. As far as I know, len and range are equal status builtin functions. The only Limitations reported in the doc are about timing accuracy.

A minimal test for this would be to look for ":0(range)" in the output, to match the way ":0(len)" does now.

----------
nosy: +terry.reedy
stage:  -> needs patch
versions: +Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12953>
_______________________________________


More information about the Python-bugs-list mailing list