Added benchmark script for NYTProf-ing
This commit is contained in:
parent
5d4e0f95d7
commit
e15c32e3f7
2 changed files with 23 additions and 1 deletions
14
benchmark.pl
Executable file
14
benchmark.pl
Executable file
|
|
@ -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;
|
||||||
|
|
@ -1,4 +1,12 @@
|
||||||
use lib '/data/WebGUI/lib';
|
use lib '/data/WebGUI/lib';
|
||||||
use WebGUI;
|
use WebGUI;
|
||||||
|
|
||||||
my $app = WebGUI->new( root => '/data/WebGUI', site => 'dev.localhost.localdomain.conf' )->psgi_app;
|
# 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;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue