I'm trying to profile a script to see why it's taking so long and I'm wondering if I'm not seeing what's taking the most time.
The call (python -m profile scpt.py) takes 27671 seconds to run according to my own timing of the script, but when I sum the tottime column of the output, I get 13410.423 seconds.  That's a little shy of half the total runtime.
Can I rest assured that all that can be optimized is what's reported and that I'm not missing anything significant?  Where is the rest of the time taken up?  Is it the profiler code which is doubling the actual time it takes to run the script without the profiler?  If not, is there a way to obtain running time stats that I'm missing?
The missing time is time when the program was blocked on IO.
The profile module only measures CPU time. It is not an IO profiler.
This is the difference between wall time and CPU time.
Why doesn't the sum of tottime in `python -m profile scpt.py` come close to the total running time?