As requested by /msg from mirod on Benchmarking CGI::Simple is just under 3 times faster performing the most common function - getting the value of a param. It is variably faster on other common operations. Load times are more difficult to evaluate accurately. I would be interested in what you find.
use Benchmark;
use CGI;
use CGI::Simple;
$ENV{'QUERY_STRING'} = 'foo=bar&baz=boo';
$q = new CGI;
$s = new CGI::Simple;
timethese(250000, {'CGI' =>'$q->param("baz")', 'Simple' => '$s->param(
+"baz")'});
__DATA__
Benchmark: timing 250000 iterations of CGI, Simple...
CGI: 27 wallclock secs (27.19 usr + 0.00 sys = 27.19 CPU) @ 91
+94.56/s (n=250000)
Simple: 10 wallclock secs ( 9.99 usr + 0.00 sys = 9.99 CPU) @ 25
+025.03/s (n=250000)
Update
For a more in depth analysis see CGI::Simple vs CGI.pm - Is twice as fast good enough?
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|