in reply to Startup cost, CGI performance

The discrepancy in times could be due to the fact that ab also measures the time to transfer all the data in your web page. If the page is big, that could take some time.

To find out where your time is going, use Devel::DProf. It will tell you exactly where the time is being spent. If it really is mostly compiling modules, switching to mod_perl will remove the issue completely. It's faster than PHP too.

Replies are listed 'Best First'.
Re: Re: Startup cost, CGI performance
by l3nz (Friar) on Jan 14, 2004 at 09:38 UTC
    ab should be able to separate transfer time from execution time. If ab is used on the same machine, it will take a huge image to make for circa 1 second of additional transfer time. If there's a suspect anyway that's transfer time being taken, it should be trivial to hack the script so that the image is created but not output and then try to benchmark this case (but it's not worth much, after you discover that - say - it's Apache taking the additional second for its buffers or something like that).
Re: Re: Startup cost, CGI performance
by dd-b (Pilgrim) on Jan 14, 2004 at 05:24 UTC

    Sounds to me like this will just give me a fourth number, presumably different from the other three, though, rather than tell me which one is right :-). And does it deal with module load time and perl interpreter startup time?

      It will not give you a fourth number; it will give you a detailed list of how long your program is spending in each chunk of code. That's what you need, if you're looking to speed things up.