diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-06 17:50:16 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-06 17:50:16 +0000 |
commit | 5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch) | |
tree | 298c3d2f08bdfe5689998b11892d72a897985be1 /benchmarks/cmop/loading-benchmark.pl | |
download | Moose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz |
Moose-2.1405HEADMoose-2.1405master
Diffstat (limited to 'benchmarks/cmop/loading-benchmark.pl')
-rwxr-xr-x | benchmarks/cmop/loading-benchmark.pl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/benchmarks/cmop/loading-benchmark.pl b/benchmarks/cmop/loading-benchmark.pl new file mode 100755 index 0000000..612ae63 --- /dev/null +++ b/benchmarks/cmop/loading-benchmark.pl @@ -0,0 +1,27 @@ +#!perl -w +use strict; +use Benchmark qw(:all); + +my ( $count, $module ) = @ARGV; +$count ||= 10; +$module ||= 'Moose'; + +my @blib + = qw(-Iblib/lib -Iblib/arch -I../Moose/blib/lib -I../Moose/blib/arch -I../Moose/lib); + +$| = 1; # autoflush + +print 'Installed: '; +system $^X, '-le', 'require Moose; print $INC{q{Moose.pm}}'; + +print 'Blead: '; +system $^X, @blib, '-le', 'require Moose; print $INC{q{Moose.pm}}'; + +cmpthese timethese $count => { + released => sub { + system( $^X, '-e', "require $module" ) == 0 or die; + }, + blead => sub { + system( $^X, @blib, '-e', "require $module" ) == 0 or die; + }, +}; |