diff --git a/benchmark.pl b/benchmark.pl new file mode 100755 index 000000000..329a95c7b --- /dev/null +++ b/benchmark.pl @@ -0,0 +1,14 @@ +# Little script used to run benchmarks against dev.localhost.localdomain +# +# To profile, run "perl -d:NYTProf benchmark.pl" + +use lib '/data/WebGUI/lib'; +use WebGUI; +use Plack::Test; +use HTTP::Request::Common; +my $app = WebGUI->new( root => '/data/WebGUI', site => 'dev.localhost.localdomain.conf' )->psgi_app; + +test_psgi $app, sub { + my $cb = shift; + my $res = $cb->( GET "/" ); +} for 1..100; diff --git a/etc/dev.localhost.localdomain.psgi b/etc/dev.localhost.localdomain.psgi index 2ffcee8a4..6306850cc 100644 --- a/etc/dev.localhost.localdomain.psgi +++ b/etc/dev.localhost.localdomain.psgi @@ -1,4 +1,12 @@ use lib '/data/WebGUI/lib'; use WebGUI; -my $app = WebGUI->new( root => '/data/WebGUI', site => 'dev.localhost.localdomain.conf' )->psgi_app; \ No newline at end of file +# Some ways to achieve the same thing from the command line: +# plackup -MWebGUI -e 'WebGUI->new' +# plackup -MWebGUI -e 'WebGUI->new("dev.localhost.localdomain.conf")' +# plackup -MWebGUI -e 'WebGUI->new(root => "/data/WebGUI", site => "dev.localhost.localdomain.conf")' +# +# Or from a .psgi file: +# my $app = WebGUI->new( root => '/data/WebGUI', site => 'dev.localhost.localdomain.conf' )->psgi_app; +# Or equivalently (using the defaults): +WebGUI->new; \ No newline at end of file