Perl/CGI performance issue

by David Mintz <mambomintz(at)yahoo.com>

 Date:  Tue, 20 Jun 2000 08:13:24 -0700 (PDT)
 To:  hwg-languages(at)hwg.org
  todo: View Thread, Original
I'm starting to get disgusted with the slow response
of some of my Perl/CGI programs and I'm trying to
figure out where the bottleneck is and how to fix it.

I rent space on a shared server. Scripts that are
short and simple, e.g., that send mail somewhere and
say have a nice day, perform quite acceptably. But
ones that, say, build complicated queries and submit
them to my host's mSQL server and return results to
the browser... 20 seconds is typical.(See for example
http://najit.org/cgi-najit/msql/najit_search.cgi?SearchType=language&start=26&language_id=Spanish%2361)
And my scripts drag even when they don't connect to my
database -- for example when the form input doesn't
pass the sanity check so it just prints a message and
prints the form again and exits.

Does an 800 line script have to take longer to do its
thing than a 40 line script by a factor of 20?  Note
that my longish programs don't actually execute every
line, far from it --- rather, different subs are
called depending on what the user is doing. But I
gather Perl has to parse the whole thing, regardless,
before execution. Is that what's killing me?

As for my code itself, I know I'm no Randall Schwartz
but I don't think it's all that inefficiently written
-- certainly not in proportion to the penalty I seem
to be getting hit with.

Or is this slowness more likely due to the load on the
server and the fact that my app is at the mercy of
everyone else's?  If that's so, how come a quickie
'hello world' script doesn't seem to suffer from the
same problem?

David Mintz
Web Design & Hosting http://www.dmintzweb.com
Personal http://www.panix.com/~dmintz

__________________________________________________
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA