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

Filename/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/MiniTrait.pm
StatementsExecuted 185 statements in 5.22ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
8774.55ms199msClass::MOP::MiniTrait::::applyClass::MOP::MiniTrait::apply
11168µs87µsClass::MOP::MiniTrait::::BEGIN@3Class::MOP::MiniTrait::BEGIN@3
11139µs112µ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
3398µs2106µs
# spent 87µs (68+19) within Class::MOP::MiniTrait::BEGIN@3 which was called: # once (68µs+19µs) by Class::MOP::Class::BEGIN@11 at line 3
use strict;
# spent 87µs making 1 call to Class::MOP::MiniTrait::BEGIN@3 # spent 19µs making 1 call to strict::import
43587µs2185µs
# spent 112µs (39+73) within Class::MOP::MiniTrait::BEGIN@4 which was called: # once (39µs+73µs) by Class::MOP::Class::BEGIN@11 at line 4
use warnings;
# spent 112µs making 1 call to Class::MOP::MiniTrait::BEGIN@4 # spent 73µs making 1 call to warnings::import
5
614µsour $VERSION = '1.11';
7155µs$VERSION = eval $VERSION;
# spent 10µs executing statements in string eval
814µsour $AUTHORITY = 'cpan:STEVAN';
9
10
# spent 199ms (4.55+194) within Class::MOP::MiniTrait::apply which was called 8 times, avg 24.8ms/call: # 2 times (3.05ms+145ms) by Class::MOP::Class::_immutable_metaclass at line 1392 of Class/MOP/Class.pm, avg 74.0ms/call # once (230µs+10.4ms) by base::import at line 14 of Moose/Meta/Method.pm # once (261µs+8.85ms) by Moose::Meta::TypeCoercion::BEGIN@8 at line 25 of Moose/Meta/Attribute.pm # once (258µs+8.80ms) by Moose::BEGIN@23 at line 15 of Moose/Meta/Instance.pm # once (304µs+8.70ms) by Moose::BEGIN@19 at line 31 of Moose/Meta/Class.pm # once (222µs+6.50ms) by Moose::BEGIN@27 at line 29 of Moose/Meta/Role.pm # once (216µs+5.77ms) by Moose::Meta::Class::BEGIN@21 at line 15 of Moose/Error/Default.pm
sub apply {
111744.46ms my ( $to_class, $trait ) = @_;
12
13 for ( grep { !ref } $to_class, $trait ) {
14148.64ms Class::MOP::load_class($_);
# spent 8.64ms making 14 calls to Class::MOP::load_class, avg 617µs/call
151414.4ms $_ = Class::MOP::Class->initialize($_);
# spent 14.4ms making 14 calls to Class::MOP::Class::initialize, avg 1.03ms/call
16 }
17
18816.3ms for my $meth ( $trait->get_all_methods ) {
# spent 16.3ms making 8 calls to Class::MOP::Class::get_all_methods, avg 2.04ms/call
1956359µs my $meth_name = $meth->name;
# spent 359µs making 56 calls to Class::MOP::Method::name, avg 6µs/call
20
21148149ms if ( $to_class->find_method_by_name($meth_name) ) {
# spent 83.8ms making 46 calls to Class::MOP::Class::add_around_method_modifier, avg 1.82ms/call # spent 64.5ms making 56 calls to Class::MOP::Class::find_method_by_name, avg 1.15ms/call # spent 301µs making 46 calls to Class::MOP::Method::body, avg 7µs/call
22 $to_class->add_around_method_modifier( $meth_name, $meth->body );
23 }
24 else {
25205.63ms $to_class->add_method( $meth_name, $meth->clone );
# spent 4.64ms making 10 calls to Class::MOP::Mixin::HasMethods::add_method, avg 464µs/call # spent 988µs making 10 calls to Class::MOP::Method::clone, avg 99µ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__