summaryrefslogtreecommitdiff
path: root/benchmarks/cmop/loading-benchmark.pl
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
commit5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch)
tree298c3d2f08bdfe5689998b11892d72a897985be1 /benchmarks/cmop/loading-benchmark.pl
downloadMoose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz
Diffstat (limited to 'benchmarks/cmop/loading-benchmark.pl')
-rwxr-xr-xbenchmarks/cmop/loading-benchmark.pl27
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;
+ },
+};