[issue2744] Fix test_cProfile

Alexandre Vassalotti report at bugs.python.org
Tue Oct 7 00:06:07 CEST 2008


Alexandre Vassalotti <alexandre at peadrop.com> added the comment:

Have you verified the numbers? They don't look right to me.

The problem is the 2nd argument of cProfile's constructor has a
different semantic meaning than the one for profile.py. For profile.py,
it is used to set the "bias" (I presume it means the overhead) of the
profiler. But for cProfile, it's the unit (in seconds?) of timer used.

Personally, I have no idea which semantic should be preferred. So
perhaps, the best thing to do for now is remove the second argument from
the cls.profilerclass() call in test_profile.ProfileTest:

class ProfileTest:
    ...
    def do_profiling(cls):
        ...
        prof = cls.profilerclass(timer, 0.001)
        ...

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


More information about the Python-bugs-list mailing list