]> git.vpit.fr Git - perl/modules/Test-Leaner.git/commitdiff
Add a sample contrived benchmark
authorVincent Pit <vince@profvince.com>
Tue, 28 Dec 2010 11:49:55 +0000 (12:49 +0100)
committerVincent Pit <vince@profvince.com>
Tue, 28 Dec 2010 14:33:07 +0000 (15:33 +0100)
MANIFEST
samples/bench.pl [new file with mode: 0644]

index b3a5263e467eee4ddd710eaadeeb85817ff57b30..bcb88fd215d5cef91df7512d07b87b80698f4c30 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -3,6 +3,7 @@ META.yml
 Makefile.PL
 README
 lib/Test/Leaner.pm
+samples/bench.pl
 t/00-load.t
 t/01-import.t
 t/05-pass.t
diff --git a/samples/bench.pl b/samples/bench.pl
new file mode 100644 (file)
index 0000000..c84cb66
--- /dev/null
@@ -0,0 +1,13 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Benchmark qw<cmpthese>;
+
+my $n = 10_000;
+
+cmpthese 10, {
+ 'Test::More'   => sub { system "$^X -e 'use Test::More; plan q[no_plan]; pass for 1 .. $n' > /dev/null" },
+ 'Test::Leaner' => sub { system "$^X -e 'use lib q[lib]; use Test::Leaner; plan q[no_plan]; pass for 1 .. $n' > /dev/null" },
+};