pstats: negative time values

T

Tom Mortimer

Hi,

A quick question - can anyone tell me how to interpret
negative time values in pstats.Stats.print_stats() output?
Eg -

39052965 function calls (38035317 primitive calls) in -250.959 CPU
seconds

Ordered by: internal time
List reduced from 202 to 20 due to restriction <20>

ncalls tottime percall cumtime percall
filename:lineno(function)
5829 26.423 0.005 -155.269 -0.027 :0(parse)
...


This is with Python 2.4 on Linux. Is it a bug, or what
does it mean?

Thanks!

Tom
 
A

Andrew Dalke

A said:
A quick question - can anyone tell me how to interpret negative time
values in pstats.Stats.print_stats() output?

See http://docs.python.org/lib/profile-limits.html

After the profiler is calibrated, it will be more accurate (in a least
square sense), but it will sometimes produce negative numbers (when call
counts are exceptionally low, and the gods of probability work against
you :). ) Do not be alarmed by negative numbers in the profile. They
should only appear if you have calibrated your profiler, and the results
are actually better than without calibration.

See also http://docs.python.org/lib/profile-calibration.html
for information on how to change the calibration number.

Andrew
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top