I don't want to go into the interpretation discussion (for most real world scenarios these overheads have no impact at all) - but here are my tests:
1. Pure Plack
zby@zby:~/progs/bench$ cat app.psgi
sub {
my ( $env ) = @_;
return [
200,
[ 'Content-Type' => 'text/text' ],
[ 'Hello World' ]
];
}
zby@zby:~/progs/bench$ plackup
HTTP::Server::PSGI: Accepting connections at http://0:5000/
With simple ab -n 10000
I get
Requests per second: 2168.05 [#/sec] (mean)
2. Dancer
zby@zby:~/progs/bench$ cat dancer.pl
#!/usr/bin/perl
use Dancer;
get '/' => sub {
return "Why, hello there";
};
dance;
zby@zby:~/progs/bench$ perl dancer.pl
>> Dancer server 1950 listening on http://0.0.0.0:3000
== Entering the development dance floor ...
With similar ab test I get
Requests per second: 1570.49 [#/sec] (mean)
3. Mojolicious::Lite
zby@zby:~/progs/bench$ cat mojo.pl
# Using Mojolicious::Lite will enable "strict" and "warnings"
use Mojolicious::Lite;
# Route with placeholder
get '/' => sub {
my $self = shift;
$self->render(text => "Hello!");
};
# Start the Mojolicious command system
app->start;
zby@zby:~/progs/bench$ perl mojo.pl daemon
Sat Jan 22 20:37:01 2011 info Mojo::Server::Daemon:320 [2315]: Server listening (http://*:3000)
Server available at http://*:3000.
Result:
Requests per second: 763.72 [#/sec] (mean)
4. Catalyst.
Unfortunately the code is much too long to be presented here in its entirety, but the Root controller contains:
sub index :Path :Args(0) {
my ( $self, $c ) = @_;
# Hello World
$c->response->body( 'Hello World' );
}
The result is:
Requests per second: 727.93 [#/sec] (mean)
5. WebNano
zby@zby:~/progs/bench$ cat webnano.psgi
{
package MyApp;
use base 'WebNano';
1;
}
{
package MyApp::Controller;
use base 'WebNano::Controller';
sub index_action {
my $self = shift;
return 'This is my home';
}
1;
}
MyApp->new()->psgi_callback;
zby@zby:~/progs/bench$ plackup webnano.psgi
HTTP::Server::PSGI: Accepting connections at http://0:5000/
And the result:
Requests per second: 1884.54 [#/sec] (mean)
This will change after some more features are added.