diff options
Diffstat (limited to 'benchmarks/simple_class.pl')
-rw-r--r-- | benchmarks/simple_class.pl | 31 |
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 |