Apache-Mmap
view release on metacpan or search on metacpan
eg/bench.pl view on Meta::CPAN
## contents of the same file as #1 above.
## 3) Should be a URL configured with Apache::Mmap as shown in the perldoc
## for Apache::Mmap with the same contents as #1 above.
##
## Of course if you're running this script from a machine other than the
## one apache's running on adjust the URL appropriately.
##
timethese( $times, {
'1: Straight file' => q~
my $req = new HTTP::Request( 'GET',
'http://localhost/file.html' );
my $response = $ua->request($req);
carp "problem\n" unless $response->is_success();
~,
'2: open/print while <INFILE>/close' => q~
my $req = new HTTP::Request( 'GET',
'http://localhost/perl/foo' );
my $response = $ua->request($req);
carp "problem\n" unless $response->is_success();
~,
'3: Mmapped' => q~
my $req = new HTTP::Request( 'GET',
'http://localhost/mmapped.html' );
my $response = $ua->request($req);
carp "problem\n" unless $response->is_success();
~,
} );
( run in 0.407 second using v1.01-cache-2.11-cpan-de7293f3b23 )