Require Dist::Zilla 4.200016+
[gitmo/Moose.git] / benchmarks / simple_class.pl
CommitLineData
7623f774 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Benchmark::Forking qw[cmpthese];
7
8=pod
9
d03bd989 10This compares the burden of a basic Moose
11class to a basic Class::MOP class.
7623f774 12
d03bd989 13It is worth noting that the basic Moose
14class will also create a type constraint
15as well as export many subs, so this comparison
7623f774 16is really not fair :)
17
18=cut
19
d03bd989 20cmpthese(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
311;