actual time performance measurement

E

Eric S. Johansson

more questions about performance measurements in python. I solve the problems I had with shelf by not using it. I'm doing a direct pickle to and from file of an entire dictionary. That knocked off a good third of my CPU time. there was another big hit that that was quick and easy. I went from approximately 3.5 seconds down to .5 seconds CPU time.

The problem is, from hitting the submit button to new display, it is taking approximately 23 seconds. now I have my suspicions as to where the time is going but I know from hard experience that guessing at performance problems is about as productive as guessing at lottery numbers. I was under the impression from reading the documentation that if I added a different time function, it would switch to measuring elapsed time rather than CPU time consumed by the process. So I used the following:

import profile
import time
low_profile = profile.Profile(time.time)
profile.run('main()', '/tmp/correct_cgi')

this is obviously wrong as is not giving me the data I would expect but I'm not able to figure out from the documentation what is the correct way. I would appreciate a pointer to how to measure performance of an application with respect to user time. I want to confirm or deny my suspicion is that some external service I'm calling (file system, subprocesses) is causing the performance problems and I want to measure how much time they consume.

---eric
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top