Chris Devers wrote:
Gunnar Hjalmarsson wrote:
Chris Devers wrote:
if you need a speed boost then the best strategies are to [a]
use a smaller subset of CGI.pm,

Does that really make a lot of difference?

That was my understanding, but I admit I haven't benchmarked it.

If only importing part of CGI.pm offers no performance advantage,
what's the point in doing it? Just avoiding polluting your
namespace?

CGI.pm is said to include some variant of autoloading, so that methods that you don't use are not loaded at compile time. That would indicate that you are right. It's just that, considering the poor performance I measured for a simple parsing of a query-string, if using the module also for various HTML stuff would further significantly increase the CPU time needed, well...

If you use mod_perl, you don't need to compile CGI.pm (or
anything else) everytime a script is invoked, so in that respect
I can understand what you mean. But would mod_perl have a
significant impact on speed in any other respect? Isn't it still
a set of code that shall be executed?

Yes, you still end up running a lot of code with each page request, but loading everything just when Apache starts can make a big difference.

Okay, then I know I hadn't missed anything. :)

Btw, wonder how the autoloading affects that. I mean, when running
under mod_perl, you normally *want* everything to be loaded at the
start of the server, right? Is there any way to enforce that for a
module that makes use of autoloading? Or is there anything 'magic' in
CGI.pm that disables autoloading when run under mod_perl?

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to