← 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:10:38 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP/MiniTrait.pm
StatementsExecuted 185 statements in 5.24ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
8774.28ms256msClass::MOP::MiniTrait::::applyClass::MOP::MiniTrait::apply
111215µs238µsClass::MOP::MiniTrait::::BEGIN@3Class::MOP::MiniTrait::BEGIN@3
11138µs109µsClass::MOP::MiniTrait::::BEGIN@4Class::MOP::MiniTrait::BEGIN@4
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Class::MOP::MiniTrait;
2
33117µs2260µs
# spent 238µs (215+22) within Class::MOP::MiniTrait::BEGIN@3 which was called: # once (215µs+22µs) by Class::MOP::Class::BEGIN@11 at line 3
use strict;
# spent 238µs making 1 call to Class::MOP::MiniTrait::BEGIN@3 # spent 22µs making 1 call to strict::import
43584µs2181µs
# spent 109µs (38+72) within Class::MOP::MiniTrait::BEGIN@4 which was called: # once (38µs+72µs) by Class::MOP::Class::BEGIN@11 at line 4
use warnings;
# spent 109µs making 1 call to Class::MOP::MiniTrait::BEGIN@4 # spent 71µs making 1 call to warnings::import
5
614µsour $VERSION = '1.11';
7158µs$VERSION = eval $VERSION;
# spent 10µs executing statements in string eval
813µsour $AUTHORITY = 'cpan:STEVAN';
9
10
# spent 256ms (4.28+252) within Class::MOP::MiniTrait::apply which was called 8 times, avg 32.0ms/call: # 2 times (2.86ms+192ms) by Class::MOP::Class::_immutable_metaclass at line 1251 of Class/MOP/Class.pm, avg 97.3ms/call # once (256µs+12.5ms) by Moose::BEGIN@19 at line 31 of Moose/Meta/Class.pm # once (234µs+11.9ms) by base::import at line 14 of Moose/Meta/Method.pm # once (232µs+11.1ms) by Moose::Meta::TypeCoercion::BEGIN@8 at line 25 of Moose/Meta/Attribute.pm # once (231µs+8.66ms) by Moose::BEGIN@23 at line 15 of Moose/Meta/Instance.pm # once (232µs+8.58ms) by Moose::BEGIN@27 at line 29 of Moose/Meta/Role.pm # once (228µs+7.36ms) by Moose::Meta::Class::BEGIN@21 at line 15 of Moose/Error/Default.pm
sub apply {
1124371µs my ( $to_class, $trait ) = @_;
12
13 for ( grep { !ref } $to_class, $trait ) {
1428436µs144.41ms Class::MOP::load_class($_);
# spent 9.01ms making 14 calls to Class::MOP::load_class, avg 643µs/call, recursion: max depth 1, sum of overlapping time 4.59ms
151415.4ms $_ = Class::MOP::Class->initialize($_);
# spent 15.4ms making 14 calls to Class::MOP::Class::initialize, avg 1.10ms/call
16 }
17
18827.4ms for my $meth ( $trait->get_all_methods ) {
# spent 27.4ms making 8 calls to Class::MOP::Class::get_all_methods, avg 3.43ms/call
191123.43ms56348µs my $meth_name = $meth->name;
# spent 348µs making 56 calls to Class::MOP::Method::name, avg 6µs/call
20
2110226µs148193ms if ( $to_class->find_method_by_name($meth_name) ) {
# spent 103ms making 46 calls to Class::MOP::Class::add_around_method_modifier, avg 2.24ms/call # spent 90.2ms making 56 calls to Class::MOP::Class::find_method_by_name, avg 1.61ms/call # spent 263µs making 46 calls to Class::MOP::Method::body, avg 6µs/call
22 $to_class->add_around_method_modifier( $meth_name, $meth->body );
23 }
24 else {
25206.20ms $to_class->add_method( $meth_name, $meth->clone );
# spent 5.22ms making 10 calls to Class::MOP::Mixin::HasMethods::add_method, avg 522µs/call # spent 977µs making 10 calls to Class::MOP::Method::clone, avg 98µs/call
26 }
27 }
28}
29
30# We can't load this with use, since it may be loaded and used from Class::MOP
31# (via CMOP::Class, etc). However, if for some reason this module is loaded
32# _without_ first loading Class::MOP we need to require Class::MOP so we can
33# use it and CMOP::Class.
3413µsrequire Class::MOP;
35
36112µs1;
37
38__END__