Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

CGI::Simple vs CGI.pm - Is twice as fast good enough?

by tachyon (Chancellor)
on Feb 16, 2002 at 00:06 UTC ( [id://145790]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my ($start, $end, $cgitime, $simpletime);
    my $n = 100;
    ...
    # With use strict commented out (CGI.pm does not use strict)
    Loading CGI 100 times takes 39 seconds
    Loading CGI::Simple 100 times takes 23 seconds
    
  2. or download this
    use Benchmark;
    use CGI qw/:cgi /;
    ...
    Benchmark: timing 10000 iterations of CGI, Simple...
           CGI: 32 wallclock secs (31.20 usr +  0.00 sys = 31.20 CPU) @ 32
    +0.51/s (n=10000)
        Simple: 18 wallclock secs (18.57 usr +  0.00 sys = 18.57 CPU) @ 53
    +8.50/s (n=10000)
    
  3. or download this
    use Benchmark;
    
    ...
    Benchmark: timing 100 iterations of CGI, Simple...
           CGI: 42 wallclock secs (43.50 usr +  0.00 sys = 43.50 CPU) @  2
    +.30/s (n=100)
        Simple: 18 wallclock secs (18.56 usr +  0.00 sys = 18.56 CPU) @  5
    +.39/s (n=100)
    
  4. or download this
    C:\>type cgi.pl
    
    ...
    100 iterations using CGI::Simple takes 40 seconds
    
    C:\>
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://145790]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-04-18 03:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found