Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://603065]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2018-06-19 00:16 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (111 votes). Check out past polls.