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 compare the overhead of Class::MOP | |
d03bd989 | 11 | to the overhead of Moose. |
7623f774 | 12 | |
d03bd989 | 13 | The goal here is to see how much more |
7623f774 | 14 | startup cost Moose adds to Class::MOP. |
15 | ||
16 | NOTE: | |
d03bd989 | 17 | This benchmark may not be all that |
18 | relevant really, but it's helpful to | |
7623f774 | 19 | see maybe. |
20 | ||
21 | =cut | |
22 | ||
d03bd989 | 23 | cmpthese(5_000, |
7623f774 | 24 | { |
25 | 'w/out_moose' => sub { | |
26 | eval 'use Class::MOP;'; | |
27 | }, | |
28 | 'w_moose' => sub { | |
29 | eval 'use Moose;'; | |
d03bd989 | 30 | }, |
7623f774 | 31 | } |
32 | ); | |
33 | ||
34 | 1; |