Well, there's no one answer for each situation...it all varies(as with most things in life).

1)I'm not sure what you mean? Like a $dbh->connect() call verse an open()? Certainly a connect() call is faster than a sleep(1000) call, the latter of which is perl-only, so it just depends.

2)Well, somewhat true. There are different loading methods that can be implemented to load-on-demand, so to speak. However, using a module usually means that its been tested and it usually anticipates more conditions than you would, so its usually the better choice(I do use usually, b/c as I said, it all varies; though if neccessary, you can edit a module down to size, to fit your purposes).

3)I don't follow here...if you're using mod_perl? Then you can have Apache cache the modules upon loading up your machine, an it won't require extra time accross different script invocations. And user-created modules are no different from standard modules--at least to Apache.

4)Well, again, guess what? It depends. Mostly, it depends how the module was designed. For instance, CGI.pm, according to CGI Programming with Perl is slower if non-OO methods are used, so OO methods are better. Bottom line: Benchmark.

5)YES! Static HTML pages are *much* faster(well, generally). This is because to create a CGI script requires creating a separate proccess on the server's machine. . . this takes time. Using mod_perl, fast cgi, etc., can take away some of this time, but on general static HTML is faster(quite a bit, usually).

Bottom line to a long post: It all depends, so BENCHMARK THE CODE. Situations change/vary, things can be true for one thing, exceptions arise, etc. Cold, hard rules are hard to come by in way of efficiency.


In reply to Re: Perl CGI and SSI speed by dimmesdale
in thread Perl CGI and SSI speed by legLess

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.