Commit | Line | Data |
---|---|---|
7623f774 | 1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use Benchmark::Forking qw[cmpthese]; | |
7 | ||
8 | =pod | |
9 | ||
d03bd989 | 10 | This compares the burden of a basic Moose |
11 | class to a basic Class::MOP class. | |
7623f774 | 12 | |
d03bd989 | 13 | It is worth noting that the basic Moose |
14 | class will also create a type constraint | |
15 | as well as export many subs, so this comparison | |
7623f774 | 16 | is really not fair :) |
17 | ||
18 | =cut | |
19 | ||
d03bd989 | 20 | cmpthese(5_000, |
21 | { | |
7623f774 | 22 | 'w/out_moose' => sub { |
23 | eval 'package Bar; use metaclass;'; | |
24 | }, | |
25 | 'w_moose' => sub { | |
26 | eval 'package Baz; use Moose;'; | |
d03bd989 | 27 | }, |
7623f774 | 28 | } |
29 | ); | |
30 | ||
31 | 1; |