Performance of CGI Reduced

P

Praki

Hi All,

when i use

use CGI;
use CGI::Session;
use Net::LDAP;

in my cgi file the performance is reduced. i mean it takes more time
to get load every time and all the pages where ever i use this .
why it is happening ? is there any other alternative for this...

Thanks,
Prakash
 
J

Japhio

use CGI;
use CGI::Session;
use Net::LDAP;

in my cgi file the performance is reduced. i mean it takes more time
to get load every time and all the pages where ever i use this .

More time than what?
Using those modules means slurping several thousand lines of code into
your program, and yes, that takes some time.
why it is happening ? is there any other alternative for this...

If you are using Apache, have a look at mod_perl http://perl.apache.org/,
which embeds a Perl interpreter in your webserver and caches the
compiled Perl code.
 
X

xhoster

Praki said:
Hi All,

when i use

use CGI;
use CGI::Session;
use Net::LDAP;

in my cgi file the performance is reduced.

As compared to what? Using none of the above? Using one of the above?
Using two of the above?
i mean it takes more time
to get load every time and all the pages where ever i use this .
why it is happening ? is there any other alternative for this...

mod_perl, for example. See the FAQ "How can I make my CGI script more
efficient?"

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 
G

Gunnar Hjalmarsson

Petr said:
You can use part only

use CGI qw:)cgi);
or
use CGI qw:)standard);
or other part you need.

That would import a bunch of symbols, and I don't understand how it
would improve performance.

To the OP: As others have mentioned, you may want to run the program
under mod_perl. Otherwise, as long as you run it as a plain CGI script,
and if speed is an issue, avoid using CGI.pm.
 
A

A. Sinan Unur

....


That would import a bunch of symbols, and I don't understand how it
would improve performance.

Given that most of the penalty for using CGI.pm comes from having to
load, parse and compile that behemoth, changing the set of imported
routines would, as you point out, not increase performance.
To the OP: As others have mentioned, you may want to run the program
under mod_perl. Otherwise, as long as you run it as a plain CGI
script, and if speed is an issue, avoid using CGI.pm.

And one very good way to avoid CGI.pm (so long as one does not need the
HTML generation methods) is to use CGI::Minimal:

http://search.cpan.org/~snowhare/CGI-Minimal-1.29/lib/CGI/Minimal.pod

I would still prefer to go with a CPAN module than home-brew solutions.

Sinan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top