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:\>