summaryrefslogtreecommitdiff
path: root/benchmarks/simple_class.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/simple_class.pl
downloadMoose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz
Diffstat (limited to 'benchmarks/simple_class.pl')
-rw-r--r--benchmarks/simple_class.pl31
1 files changed, 31 insertions, 0 deletions
diff --git a/benchmarks/simple_class.pl b/benchmarks/simple_class.pl
new file mode 100644
index 0000000..f0061f1
--- /dev/null
+++ b/benchmarks/simple_class.pl
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Benchmark::Forking qw[cmpthese];
+
+=pod
+
+This compares the burden of a basic Moose
+class to a basic Class::MOP class.
+
+It is worth noting that the basic Moose
+class will also create a type constraint
+as well as export many subs, so this comparison
+is really not fair :)
+
+=cut
+
+cmpthese(5_000,
+ {
+ 'w/out_moose' => sub {
+ eval 'package Bar; use metaclass;';
+ },
+ 'w_moose' => sub {
+ eval 'package Baz; use Moose;';
+ },
+ }
+);
+
+1; \ No newline at end of file