in reply to /^mod_perl/ && Persistent DBI

There is no point in having persistent connections in CGI/MySQL configuration. Unlike Oracle and many other SQL servers database handle initialization is very cheap in MySQL. I bet you will find that most overhead comes not from database handle initialization but from loading DBI and all other modules in your CGI script.

But really only benchmarking can show it. BTW have you tried to benchmark your code? Benchmarking may help you to improve your code in terms of perfomance much better than any blind optimization of some things you suspect to be slow.

--
Ilya Martynov (http://martynov.org/)