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 | |
10 | This compares the burden of a basic Moose |
11 | class to a basic Class::MOP class. |
12 | |
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 |
16 | is really not fair :) |
17 | |
18 | =cut |
19 | |
20 | cmpthese(5_000, |
21 | { |
22 | 'w/out_moose' => sub { |
23 | eval 'package Bar; use metaclass;'; |
24 | }, |
25 | 'w_moose' => sub { |
26 | eval 'package Baz; use Moose;'; |
27 | }, |
28 | } |
29 | ); |
30 | |
31 | 1; |