← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 22:00:36 2010
Reported on Wed Nov 17 22:09:56 2010

Filename/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Meta.pm
StatementsExecuted 3170 statements in 54.9ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1742218.1ms302msClass::MOP::Method::Meta::::wrapClass::MOP::Method::Meta::wrap
174114.99ms4.99msClass::MOP::Method::Meta::::_generate_meta_methodClass::MOP::Method::Meta::_generate_meta_method
1113.06ms4.36msClass::MOP::Method::Meta::::BEGIN@14Class::MOP::Method::Meta::BEGIN@14
42111.68ms4.63msClass::MOP::Method::Meta::::_make_compatible_withClass::MOP::Method::Meta::_make_compatible_with
11163µs79µsClass::MOP::Method::Meta::::BEGIN@4Class::MOP::Method::Meta::BEGIN@4
11152µs180µsClass::MOP::Method::Meta::::BEGIN@8Class::MOP::Method::Meta::BEGIN@8
11144µs7.50msClass::MOP::Method::Meta::::BEGIN@16Class::MOP::Method::Meta::BEGIN@16
11136µs208µsClass::MOP::Method::Meta::::BEGIN@7Class::MOP::Method::Meta::BEGIN@7
11136µs96µ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
4393µs295µs
# spent 79µs (63+16) within Class::MOP::Method::Meta::BEGIN@4 which was called: # once (63µs+16µs) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 4
use strict;
# spent 79µs making 1 call to Class::MOP::Method::Meta::BEGIN@4 # spent 16µs making 1 call to strict::import
53110µs2157µs
# spent 96µs (36+61) within Class::MOP::Method::Meta::BEGIN@5 which was called: # once (36µs+61µs) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 5
use warnings;
# spent 96µs making 1 call to Class::MOP::Method::Meta::BEGIN@5 # spent 61µs making 1 call to warnings::import
6
73108µs2380µs
# spent 208µs (36+172) within Class::MOP::Method::Meta::BEGIN@7 which was called: # once (36µs+172µs) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 7
use Carp 'confess';
# spent 208µs making 1 call to Class::MOP::Method::Meta::BEGIN@7 # spent 172µs making 1 call to Exporter::import
83243µs2308µs
# spent 180µs (52+128) within Class::MOP::Method::Meta::BEGIN@8 which was called: # once (52µs+128µ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 128µs making 1 call to Exporter::import
9
1015µsour $VERSION = '1.11';
11159µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
1214µsour $AUTHORITY = 'cpan:STEVAN';
13
143632µs24.64ms
# spent 4.36ms (3.06+1.30) within Class::MOP::Method::Meta::BEGIN@14 which was called: # once (3.06ms+1.30ms) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 14
use constant DEBUG_NO_META => $ENV{DEBUG_NO_META} ? 1 : 0;
# spent 4.36ms making 1 call to Class::MOP::Method::Meta::BEGIN@14 # spent 282µs making 1 call to constant::import
15
1631.10ms27.50ms
# spent 7.50ms (44µs+7.45) within Class::MOP::Method::Meta::BEGIN@16 which was called: # once (44µs+7.45ms) by Class::MOP::Mixin::HasMethods::BEGIN@6 at line 16
use base 'Class::MOP::Method';
# spent 7.50ms making 1 call to Class::MOP::Method::Meta::BEGIN@16 # spent 7.45ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 7.45ms
17
18sub _is_caller_mop_internal {
19 my $self = shift;
20 my ($caller) = @_;
21 return $caller =~ /^(?:Class::MOP|metaclass)(?:::|$)/;
22}
23
24
# spent 4.99ms within Class::MOP::Method::Meta::_generate_meta_method which was called 174 times, avg 29µs/call: # 174 times (4.99ms+0s) by Class::MOP::Method::Meta::wrap at line 57, avg 29µs/call
sub _generate_meta_method {
255225.54ms my $method_self = shift;
26 my $metaclass = shift;
27 sub {
28 # this will be compiled out if the env var wasn't set
29128228.2ms 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.
44128245.7ms $metaclass->initialize(blessed($_[0]) || $_[0])
# spent 46.2ms making 641 calls to Class::MOP::Class::initialize, avg 72µs/call, recursion: max depth 1, sum of overlapping time 4.43ms # spent 3.90ms making 641 calls to Scalar::Util::blessed, avg 6µs/call
45 };
46}
47
48
# spent 302ms (18.1+284) within Class::MOP::Method::Meta::wrap which was called 174 times, avg 1.73ms/call: # 151 times (15.7ms+251ms) by Moose::Meta::Method::Meta::wrap at line 24 of Moose/Meta/Method/Meta.pm, avg 1.76ms/call # 23 times (2.36ms+33.2ms) by Class::MOP::Mixin::HasMethods::_add_meta_method at line 28 of Class/MOP/Mixin/HasMethods.pm, avg 1.54ms/call
sub wrap {
49121817.2ms my ($class, @args) = @_;
50
51 unshift @args, 'body' if @args % 2 == 1;
52 my %params = @args;
53 confess "Overriding the body of meta methods is not allowed"
54 if $params{body};
55
5617415.3ms my $metaclass_class = $params{associated_metaclass}->meta;
# spent 7.81ms making 92 calls to Class::MOP::Object::meta, avg 85µs/call # spent 3.90ms making 42 calls to MooseX::Role::Parameterized::Meta::Role::Parameterized::meta, avg 93µs/call # spent 3.42ms making 38 calls to Moose::Meta::Role::meta, avg 90µs/call # spent 179µs making 2 calls to MooseX::Role::Parameterized::Meta::Role::Parameterizable::meta, avg 90µs/call
571744.99ms $params{body} = $class->_generate_meta_method($metaclass_class);
# spent 4.99ms making 174 calls to Class::MOP::Method::Meta::_generate_meta_method, avg 29µs/call
58174264ms return $class->SUPER::wrap(%params);
# spent 264ms making 174 calls to Class::MOP::Method::wrap, avg 1.51ms/call
59}
60
61
# spent 4.63ms (1.68+2.95) within Class::MOP::Method::Meta::_make_compatible_with which was called 42 times, avg 110µs/call: # 42 times (1.68ms+2.95ms) by Moose::Meta::Method::Meta::_make_compatible_with at line 29 of Moose/Meta/Method/Meta.pm, avg 110µs/call
sub _make_compatible_with {
621261.58ms my $self = shift;
63 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
75842.95ms return $self unless $other->_is_compatible_with($self->_real_ref_name);
# spent 1.73ms making 42 calls to Class::MOP::Object::_is_compatible_with, avg 41µs/call # spent 1.21ms making 42 calls to Class::MOP::Object::_real_ref_name, avg 29µs/call
76
77 return $self->SUPER::_make_compatible_with(@_);
78}
79
80111µs1;
81
82__END__