← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 10:04:38 2014
Reported on Tue Jun 24 10:05:29 2014

Filename/usr/local/lib/perl/5.14.2/Class/MOP/MiniTrait.pm
StatementsExecuted 343 statements in 964µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
877733µs30.0msClass::MOP::MiniTrait::::applyClass::MOP::MiniTrait::apply
1119µs9µsClass::MOP::MiniTrait::::BEGIN@2Class::MOP::MiniTrait::BEGIN@2
1117µs11µsClass::MOP::MiniTrait::::BEGIN@9Class::MOP::MiniTrait::BEGIN@9
1117µs12µsClass::MOP::MiniTrait::::BEGIN@10Class::MOP::MiniTrait::BEGIN@10
1117µs53µsClass::MOP::MiniTrait::::BEGIN@12Class::MOP::MiniTrait::BEGIN@12
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
# spent 9µs within Class::MOP::MiniTrait::BEGIN@2 which was called: # once (9µs+0s) by Class::MOP::Class::BEGIN@17 at line 4
BEGIN {
315µs $Class::MOP::MiniTrait::AUTHORITY = 'cpan:STEVAN';
4130µs19µs}
# spent 9µs making 1 call to Class::MOP::MiniTrait::BEGIN@2
5{
621µs $Class::MOP::MiniTrait::VERSION = '2.1005';
7}
8
9222µs214µs
# spent 11µs (7+3) within Class::MOP::MiniTrait::BEGIN@9 which was called: # once (7µs+3µs) by Class::MOP::Class::BEGIN@17 at line 9
use strict;
# spent 11µs making 1 call to Class::MOP::MiniTrait::BEGIN@9 # spent 3µs making 1 call to strict::import
10224µs218µs
# spent 12µs (7+5) within Class::MOP::MiniTrait::BEGIN@10 which was called: # once (7µs+5µs) by Class::MOP::Class::BEGIN@17 at line 10
use warnings;
# spent 12µs making 1 call to Class::MOP::MiniTrait::BEGIN@10 # spent 5µs making 1 call to warnings::import
11
122136µs299µs
# spent 53µs (7+46) within Class::MOP::MiniTrait::BEGIN@12 which was called: # once (7µs+46µs) by Class::MOP::Class::BEGIN@17 at line 12
use Class::Load qw(load_class);
# spent 53µs making 1 call to Class::MOP::MiniTrait::BEGIN@12 # spent 46µs making 1 call to Exporter::import
13
14
# spent 30.0ms (733µs+29.3) within Class::MOP::MiniTrait::apply which was called 8 times, avg 3.76ms/call: # 2 times (480µs+22.2ms) by Class::MOP::Class::_immutable_metaclass at line 1359 of Class/MOP/Class.pm, avg 11.3ms/call # once (42µs+1.68ms) by base::import at line 16 of Moose/Meta/Method.pm # once (47µs+1.32ms) by Moose::Meta::TypeCoercion::BEGIN@14 at line 29 of Moose/Meta/Attribute.pm # once (42µs+1.25ms) by Moose::BEGIN@27 at line 33 of Moose/Meta/Class.pm # once (42µs+1.02ms) by Moose::BEGIN@35 at line 31 of Moose/Meta/Role.pm # once (39µs+981µs) by Moose::BEGIN@31 at line 17 of Moose/Meta/Instance.pm # once (41µs+849µs) by Moose::Meta::Class::BEGIN@23 at line 19 of Moose/Error/Default.pm
sub apply {
1588µs my ( $to_class, $trait ) = @_;
16
172417µs for ( grep { !ref } $to_class, $trait ) {
181415µs141.78ms load_class($_);
# spent 1.78ms making 14 calls to Class::Load::load_class, avg 127µs/call
191434µs141.86ms $_ = Class::MOP::Class->initialize($_);
# spent 1.86ms making 14 calls to Class::MOP::Class::initialize, avg 133µs/call
20 }
21
2298217µs983.07ms for my $meth ( grep { $_->package_name ne 'UNIVERSAL' } $trait->get_all_methods ) {
# spent 3.03ms making 8 calls to Class::MOP::Class::get_all_methods, avg 379µs/call # spent 41µs making 90 calls to Class::MOP::Method::package_name, avg 452ns/call
2358152µs5840µs my $meth_name = $meth->name;
# spent 40µs making 58 calls to Class::MOP::Method::name, avg 684ns/call
24
2558127µs589.76ms if ( $to_class->find_method_by_name($meth_name) ) {
# spent 9.76ms making 58 calls to Class::MOP::Class::find_method_by_name, avg 168µs/call
2644141µs8811.5ms $to_class->add_around_method_modifier( $meth_name, $meth->body );
# spent 11.5ms making 44 calls to Class::MOP::Class::add_around_method_modifier, avg 262µs/call # spent 32µs making 44 calls to Class::MOP::Method::body, avg 725ns/call
27 }
28 else {
291432µs281.24ms $to_class->add_method( $meth_name, $meth->clone );
# spent 980µs making 14 calls to Class::MOP::Mixin::HasMethods::add_method, avg 70µs/call # spent 264µs making 14 calls to Class::MOP::Method::clone, avg 19µs/call
30 }
31 }
32}
33
34# We can't load this with use, since it may be loaded and used from Class::MOP
35# (via CMOP::Class, etc). However, if for some reason this module is loaded
36# _without_ first loading Class::MOP we need to require Class::MOP so we can
37# use it and CMOP::Class.
381500nsrequire Class::MOP;
39
4013µs1;
41
42# ABSTRACT: Extremely limited trait application
43
44__END__