The big speed boost you get with mod_perl over traditional CGI isn't really in the execution speed of the code. It's in the fact that the webserver doesn't have to start a new Perl interpreter and compile the script for each CGI request. So "mod_perl code" doesn't, in one good sense, run any faster than the code outside mod_perl. For fine-tuning your code, you probably want to use a combination of Benchmark and something like Devel::DProf. (note: that will only help you test out the efficiency of various algorithms; but since the integration of Perl and Apache that is mod_perl is a different environment from that of traditional CGI , it's not so obvious that you'll be able to port conclusions about how fast this script is as traditional CGI to how fast it will be under mod_perl directly; mod_perl is much more powerful than traditional CGI, which is a reason to use it independent of any speed gain)

Given that mod_perl is helping you serve web pages, the best way to measure it is to simulate an actual setup and see how it deals with it. Write a script that uses LWP to make requests to the server, and see how many pages it can serve up in a given interval. That's probably the only way to test the relative speed of mod_perl vs. say, PHP or JSP or ... $dynamic_web_content_technology

HTH

Philosophy can be made out of anything. Or less -- Jerry A. Fodor


In reply to Re: Benchmarks of mod_perl by arturo
in thread Benchmarks of mod_perl by bladx

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.