I'm running Dancer and found it slow -- pages took a long time to render.
This is the example code from Dancer::Introduction:
#!/usr/bin/perl
# make this script a webapp
use Dancer;
# declare routes/actions
get '/' => sub {
"Hello World";
};
get '/hello/:name' => sub {
"Hello ".param('name');
};
# run the webserver
Dancer->dance;
It takes my browser 10 seconds to get&render the response( using firebug in firefox ).
And Dancer message:
[20734] core @0.000228> request: GET / from 192.168.1.101 in /usr/lib/perl5/site_perl/5.8.8/Dancer/Handler.pm l. 57
[20734] core @0.000809> [hit #44]trying to match `/' against /^\/$/ in /usr/lib/perl5/site_perl/5.8.8/Dancer/Route.pm l. 84
[20734] core @0.000953> [hit #44] --> got 1 in /usr/lib/perl5/site_perl/5.8.8/Dancer/Route.pm l. 101
[20734] core @0.001645> [hit #44]response: 200 in /usr/lib/perl5/site_perl/5.8.8/Dancer/Handler.pm l. 175
[20734] core @0.000135> request: GET /favicon.ico from 192.168.1.101 in /usr/lib/perl5/site_perl/5.8.8/Dancer/Handler.pm l. 57
[20734] core @0.000873> [hit #45]response: 200 in /usr/lib/perl5/site_perl/5.8.8/Dancer/Handler.pm l. 175
Why is Dancer so slow? Did I miss something?
Is the computer connected to internet? I got the same problem when testing from a computer not connected to internet; fixed it by deleting
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>;
from main.tt