← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:45:08 2010
Reported on Wed Nov 17 22:13:17 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP/Method/Meta.pm
StatementsExecuted 3822 statements in 64.6ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2162222.7ms378msClass::MOP::Method::Meta::::wrapClass::MOP::Method::Meta::wrap
216116.29ms6.29msClass::MOP::Method::Meta::::_generate_meta_methodClass::MOP::Method::Meta::_generate_meta_method
1112.87ms4.15msClass::MOP::Method::Meta::::BEGIN@14Class::MOP::Method::Meta::BEGIN@14
42111.63ms4.56msClass::MOP::Method::Meta::::_make_compatible_withClass::MOP::Method::Meta::_make_compatible_with
11175µs92µsClass::MOP::Method::Meta::::BEGIN@4Class::MOP::Method::Meta::BEGIN@4
11152µs180µsClass::MOP::Method::Meta::::BEGIN@8Class::MOP::Method::Meta::BEGIN@8
11142µs7.41msClass::MOP::Method::Meta::::BEGIN@16Class::MOP::Method::Meta::BEGIN@16
11136µs193µsClass::MOP::Method::Meta::::BEGIN@7Class::MOP::Method::Meta::BEGIN@7
11136µs99µsClass::MOP::Method::Meta::::BEGIN@5Class::MOP::Method::Meta::BEGIN@5
0000s0sClass::MOP::Method::Meta::::__ANON__[:45]Class::MOP::Method::Meta::__ANON__[:45]
0000s0sClass::MOP::Method::Meta::::_is_caller_mop_internalClass::MOP::Method::Meta::_is_caller_mop_internal
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2package Class::MOP::Method::Meta;
3
4395µs2108µs
# spent 92µs (75+17) within Class::MOP::Method::Meta::BEGIN@4 which was called: # once (75µs+17µs) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 4
use strict;
# spent 92µs making 1 call to Class::MOP::Method::Meta::BEGIN@4 # spent 17µs making 1 call to strict::import
53132µs2162µs
# spent 99µs (36+63) within Class::MOP::Method::Meta::BEGIN@5 which was called: # once (36µs+63µs) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 5
use warnings;
# spent 99µs making 1 call to Class::MOP::Method::Meta::BEGIN@5 # spent 63µs making 1 call to warnings::import
6
73103µs2350µs
# spent 193µs (36+157) within Class::MOP::Method::Meta::BEGIN@7 which was called: # once (36µs+157µs) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 7
use Carp 'confess';
# spent 193µs making 1 call to Class::MOP::Method::Meta::BEGIN@7 # spent 157µs making 1 call to Exporter::import
83248µs2307µs
# spent 180µs (52+127) within Class::MOP::Method::Meta::BEGIN@8 which was called: # once (52µs+127µs) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 8
use Scalar::Util 'blessed';
# spent 180µs making 1 call to Class::MOP::Method::Meta::BEGIN@8 # spent 127µs making 1 call to Exporter::import
9
1015µsour $VERSION = '1.11';
11157µs$VERSION = eval $VERSION;
# spent 10µs executing statements in string eval
1214µsour $AUTHORITY = 'cpan:STEVAN';
13
143415µs24.42ms
# spent 4.15ms (2.87+1.28) within Class::MOP::Method::Meta::BEGIN@14 which was called: # once (2.87ms+1.28ms) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 14
use constant DEBUG_NO_META => $ENV{DEBUG_NO_META} ? 1 : 0;
# spent 4.15ms making 1 call to Class::MOP::Method::Meta::BEGIN@14 # spent 270µs making 1 call to constant::import
15
1631.02ms27.41ms
# spent 7.41ms (42µs+7.36) within Class::MOP::Method::Meta::BEGIN@16 which was called: # once (42µs+7.36ms) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 16
use base 'Class::MOP::Method';
# spent 7.41ms making 1 call to Class::MOP::Method::Meta::BEGIN@16 # spent 7.36ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 7.36ms
17
18sub _is_caller_mop_internal {
19 my $self = shift;
20 my ($caller) = @_;
21 return $caller =~ /^(?:Class::MOP|metaclass)(?:::|$)/;
22}
23
24
# spent 6.29ms within Class::MOP::Method::Meta::_generate_meta_method which was called 216 times, avg 29µs/call: # 216 times (6.29ms+0s) by Class::MOP::Method::Meta::wrap at line 57, avg 29µs/call
sub _generate_meta_method {
252161.03ms my $method_self = shift;
26216708µs my $metaclass = shift;
27 sub {
28 # this will be compiled out if the env var wasn't set
297571.20ms if (DEBUG_NO_META) {
30 confess "'meta' method called by MOP internals"
31 # it's okay to call meta methods on metaclasses, since we
32 # explicitly ask for them
33 if !$_[0]->isa('Class::MOP::Object')
34 && !$_[0]->isa('Class::MOP::Mixin')
35 # it's okay if the test itself calls ->meta, we only care about
36 # if the mop internals call ->meta
37 && $method_self->_is_caller_mop_internal(scalar caller);
38 }
39 # we must re-initialize so that it
40 # works as expected in subclasses,
41 # since metaclass instances are
42 # singletons, this is not really a
43 # big deal anyway.
4475731.3ms151453.5ms $metaclass->initialize(blessed($_[0]) || $_[0])
# spent 53.7ms making 757 calls to Class::MOP::Class::initialize, avg 71µs/call, recursion: max depth 1, sum of overlapping time 4.60ms # spent 4.30ms making 757 calls to Scalar::Util::blessed, avg 6µs/call
452165.04ms };
46}
47
48
# spent 378ms (22.7+355) within Class::MOP::Method::Meta::wrap which was called 216 times, avg 1.75ms/call: # 193 times (20.3ms+322ms) by Moose::Meta::Method::Meta::wrap at line 24 of Moose/Meta/Method/Meta.pm, avg 1.77ms/call # 23 times (2.44ms+33.1ms) by Class::MOP::Mixin::HasMethods::_add_meta_method at line 30 of Class/MOP/Mixin/HasMethods.pm, avg 1.55ms/call
sub wrap {
492162.28ms my ($class, @args) = @_;
50
512161.05ms unshift @args, 'body' if @args % 2 == 1;
522161.74ms my %params = @args;
53216606µs confess "Overriding the body of meta methods is not allowed"
54 if $params{body};
55
562162.82ms21618.7ms my $metaclass_class = $params{associated_metaclass}->meta;
# spent 7.56ms making 81 calls to Moose::Meta::Role::meta, avg 93µs/call # spent 7.32ms making 91 calls to Class::MOP::Object::meta, avg 80µs/call # spent 3.67ms making 42 calls to MooseX::Role::Parameterized::Meta::Role::Parameterized::meta, avg 87µs/call # spent 176µs making 2 calls to MooseX::Role::Parameterized::Meta::Role::Parameterizable::meta, avg 88µs/call
572163.37ms2166.29ms $params{body} = $class->_generate_meta_method($metaclass_class);
# spent 6.29ms making 216 calls to Class::MOP::Method::Meta::_generate_meta_method, avg 29µs/call
582169.85ms216330ms return $class->SUPER::wrap(%params);
# spent 330ms making 216 calls to Class::MOP::Method::wrap, avg 1.53ms/call
59}
60
61
# spent 4.56ms (1.63+2.94) within Class::MOP::Method::Meta::_make_compatible_with which was called 42 times, avg 109µs/call: # 42 times (1.63ms+2.94ms) by Moose::Meta::Method::Meta::_make_compatible_with at line 29 of Moose/Meta/Method/Meta.pm, avg 109µs/call
sub _make_compatible_with {
6242114µs my $self = shift;
6342159µs my ($other) = @_;
64
65 # XXX: this is pretty gross. the issue here is that CMOP::Method::Meta
66 # objects are subclasses of CMOP::Method, but when we get to moose, they'll
67 # need to be compatible with Moose::Meta::Method, which isn't possible. the
68 # right solution here is to make ::Meta into a role that gets applied to
69 # whatever the method_metaclass happens to be and get rid of
70 # _meta_method_metaclass entirely, but that's not going to happen until
71 # we ditch cmop and get roles into the bootstrapping, so. i'm not
72 # maintaining the previous behavior of turning them into instances of the
73 # new method_metaclass because that's equally broken, and at least this way
74 # any issues will at least be detectable and potentially fixable. -doy
75421.29ms842.94ms return $self unless $other->_is_compatible_with($self->_real_ref_name);
# spent 1.81ms making 42 calls to Class::MOP::Object::_is_compatible_with, avg 43µs/call # spent 1.13ms making 42 calls to Class::MOP::Object::_real_ref_name, avg 27µs/call
76
77 return $self->SUPER::_make_compatible_with(@_);
78}
79
80111µs1;
81
82__END__