package CMMChild::Before;
use Class::Method::Modifiers;
use base 'PlainParent';
-
+
before method => sub { "B" };
}
{
package MooseBefore;
use Moose;
- extends 'PlainParent';
+ extends 'MooseParent';
before method => sub { "B" };
}
package CMMChild::Around;
use Class::Method::Modifiers;
use base 'PlainParent';
-
+
around method => sub { shift->() . "A" };
}
{
package MooseAround;
use Moose;
- extends 'PlainParent';
+ extends 'MooseParent';
around method => sub { shift->() . "A" };
}
package CMMChild::AllThree;
use Class::Method::Modifiers;
use base 'PlainParent';
-
+
before method => sub { "B" };
around method => sub { shift->() . "A" };
after method => sub { "Z" };
{
package MooseAllThree;
use Moose;
- extends 'PlainParent';
+ extends 'MooseParent';
before method => sub { "B" };
around method => sub { shift->() . "A" };
after method => sub { "Z" };
}
+{
+ package CMM::Install;
+ use Class::Method::Modifiers;
+ use base 'PlainParent';
+}
+{
+ package Moose::Install;
+ use Moose;
+ extends 'MooseParent';
+}
use Benchmark qw(cmpthese);
use Benchmark ':hireswallclock';
ClassMethodModifiers => sub { $cmm_allthree->method() },
}, 'noc');
+print "\nINSTALL AROUND\n";
+cmpthese($rounds, {
+ Moose => sub {
+ package Moose::Install;
+ Moose::Install::around(method => sub {});
+ },
+ ClassMethodModifiers => sub {
+ package CMM::Install;
+ CMM::Install::around(method => sub {});
+ },
+}, 'noc');
+