X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=benchmarks%2Fmethod_modifiers.pl;h=16f1c5efb4997353830d7e73706f6cc27c332251;hb=43b9a91cacfa5e209171acd1141e3ad8e8a2d31a;hp=2d2986b8a713e03d65e66a38599b58fcb920cd75;hpb=2727db2853b41d525a54957c36235d270058fdcf;p=gitmo%2FMoose.git diff --git a/benchmarks/method_modifiers.pl b/benchmarks/method_modifiers.pl index 2d2986b..16f1c5e 100755 --- a/benchmarks/method_modifiers.pl +++ b/benchmarks/method_modifiers.pl @@ -17,7 +17,7 @@ package CMMChild::Before; use Class::Method::Modifiers; use base 'PlainParent'; - + before method => sub { "B" }; } { @@ -32,7 +32,7 @@ package CMMChild::Around; use Class::Method::Modifiers; use base 'PlainParent'; - + around method => sub { shift->() . "A" }; } { @@ -47,7 +47,7 @@ package CMMChild::AllThree; use Class::Method::Modifiers; use base 'PlainParent'; - + before method => sub { "B" }; around method => sub { shift->() . "A" }; after method => sub { "Z" }; @@ -61,6 +61,16 @@ 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'; @@ -93,3 +103,15 @@ cmpthese($rounds, { 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'); +