6 use Benchmark qw[cmpthese];
10 This benchmark compares the overhead of a
11 auto-created type constraint vs. none at
12 all vs. a custom-created type.
19 use Moose::Util::TypeConstraints;
21 has 'baz' => (is => 'rw');
22 has 'bar' => (is => 'rw', isa => 'Foo');
23 #has 'boo' => (is => 'rw', isa => type 'CustomFoo' => where { blessed($_) && $_->isa('Foo') });
29 sub new { bless {} => __PACKAGE__ }
32 $self->{bar} = shift if @_;
45 'w/out_constraint' => sub {
48 'w_constraint' => sub {
51 #'w_custom_constraint' => sub {