* Moose::Meta::Attribute
- changed how we do type checks so that
- we reduce the overall cost by approx.
- factor of 5
+ we reduce the overall cost, but still
+ retain correctness.
* Moose::Meta::TypeConstraint
- changed how constraints are compiled
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Benchmark::Forking qw[cmpthese];
+
+=pod
+
+This compares the burden of a basic Moose
+class to a basic Class::MOP class.
+
+It is worth noting that the basic Moose
+class will also create a type constraint
+as well as export many subs, so this comparison
+is really not fair :)
+
+=cut
+
+cmpthese(5_000,
+ {
+ 'w/out_moose' => sub {
+ eval 'package Bar; use metaclass;';
+ },
+ 'w_moose' => sub {
+ eval 'package Baz; use Moose;';
+ },
+ }
+);
+
+1;
\ No newline at end of file
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Benchmark::Forking qw[cmpthese];
+
+=pod
+
+This compare the overhead of Class::MOP
+to the overhead of Moose.
+
+The goal here is to see how much more
+startup cost Moose adds to Class::MOP.
+
+NOTE:
+This benchmark may not be all that
+relevant really, but it's helpful to
+see maybe.
+
+=cut
+
+cmpthese(5_000,
+ {
+ 'w/out_moose' => sub {
+ eval 'use Class::MOP;';
+ },
+ 'w_moose' => sub {
+ eval 'use Moose;';
+ },
+ }
+);
+
+1;
\ No newline at end of file
use Benchmark qw[cmpthese];
+=pod
+
+This benchmark compares the overhead of a
+auto-created type constraint vs. none at
+all vs. a custom-created type.
+
+=cut
+
{
package Foo;
use Moose;