In (my) simple terms: If that servlet is held in memory after being called for the first time, you save the repeated loading of the code for each request. This doesn't happen if you are using a CGI script. Each call of the CGI script causes the server to read the script file from hard disk (or wherever it is stored) (and interpret it) and execute it. If there are a thousand requests of that script, it will be loaded from disk for a thousand times...

As we don't know what you exactly mean with servlet, I think of the difference between mod_perl and "plain" CGI. Others, who have a deeper insight in this topic may be able to provide further details, documentation links or corrections of my words.


In reply to Re: instances of CGI in web server by linuxer
in thread instances of CGI in web server by shahzama

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.