in reply to Re: Re: Re: Re: Startup cost, CGI performance
in thread Startup cost, CGI performance

I can see several things in there that you might want to do spot performance analysis on. For example, how long does
$galinfo = LoadFile ("galinfo.yaml");
take? Run down the code, and any place you're doing something that you can't easily characterize behavior on, throw some timing code around it. You can emit the raw timing info in an HTML comment, and get at it via View Source.

Another thing to note, if you aren't clear on it, is that putting a use inside a conditional doesn't make the use conditional; it just limits scope.

You might also consider whether you really need File::stat, or can make do with built-ins.

Replies are listed 'Best First'.
Re: Re^5: Startup cost, CGI performance
by dd-b (Pilgrim) on Jan 15, 2004 at 04:12 UTC
    The YAML read takes about .5 seconds in this case -- it's there in the timings in my original post, and has been discussed already. That's the single big chunk of time, other than loading the modules. However, the application depends on manual editing of that file as well as automated reading/writing, so changing it to a binary format would require me to develop a whole new application for the "manual editing", so that's low on my priorities.

    Is File::stat particularly big? I could work around dropping that. I'll look/test that; I'm not hopeful, though, the .pm file is only 2.8k, plus it pulls in Class::Struct which is 18.7k. I guess if nothing else pulls in Class::Struct that might be of some significance.