Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: My CGI is slow, but I don't think it's my fault.

by jimt (Chaplain)
on Mar 03, 2007 at 16:05 UTC ( #603065=note: print w/ replies, xml ) Need Help??


in reply to Re: My CGI is slow, but I don't think it's my fault.
in thread My CGI is slow, but I don't think it's my fault.

And Perrin gets the gold star. Right on both counts.

Re-profiling with dprofpp -r (d'oh. There's an option which I'll need to remember) yielded:

Total Elapsed Time = 22.28669 Seconds Real Time = 22.28669 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 59.2 13.20 13.200 314 0.0420 0.0420 DBI::db::ping

Basically, every time it tried to grab a cached database handle, it would ping it first to make sure it was still valid. Useful in persistent environments (mod_perl, etc.) or long running scripts, but not so much on a website that's all CGI and nothing survives long. I figured I could take the risk of having the database handle vanish in that time, so I shut off the constant re-pinging.

Next profile dropped the total run time down to 5.45 seconds, with 83% of my time spent executing queries. Much more reasonable. And I'm sure I can get that runtime down even farther with some judicious indexing.

Thanks!


Comment on Re^2: My CGI is slow, but I don't think it's my fault.
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://603065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-07-22 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (106 votes), past polls