Still working on performance of my picpage module, as discussed here.
Since profiling seemed to say most of the time was taken up loading modules, it looks like mod_perl would be a big help, right? And Apache::Registry should buy me that performance improvement? Since it caches scripts once compiled? (Yes, I know I probably get a different apache process on each connect, and I'll have to get the script loaded into all of them before I'll see a consistent performance improvement.)
Little improvement. With almost no changes the script functioned under Apache::Registry, but with only about a 10% performance improvement.
Then I added a perl startup script to force preloading of several of the big modules I used in the script (straight out of Writing Apache Modules with Perl and C, with the names of the modules I wanted). Still no major performance improvement.
Then I removed a couple of modules I had better alternatives to in Apache::Util (so making the script specific to mod_perl, no longer able to run as straight CGI). Functions correctly, but still no particular performance improvement.
So I'm now trying to run a BIG batch of runs of the script, to make sure that it's been called in each httpd process (I'm doing 2x the number of processes I'm running; of course this doesn't guarantee hitting every single one), and then benchmark after that. Waiting for that to run as I type this...and it's done, and the performance is about where I started. My very initial CGI version was taking about 3.5 seconds per image according to ab, and this one is taking 2.7. The initial analysis showed module loading taking 2.5 seconds, YAML reading taking .5, and nothing else as much as .01. This isn't enough of an improvement.
Clearly the next step will be profiling within the script as run, and see where that time goes. But it's really weird that eliminating the module load time hasn't made any difference. I'm sure I'm running through mod_perl rather than CGI -- it's not in a scriptalias directory and doesn't have extension CGI, so on my server it wouldn't execute at all if the config to run it through mod_perl wasn't right. And using Apache::Util works, which it wouldn't if I weren't running through mod_perl.
Any other suggestions?
In reply to CGI to Apache::Registry, or to mod_perl by dd-b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |