← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/pan_genome_post_analysis
  Run on Fri Mar 27 11:43:32 2015
Reported on Fri Mar 27 11:46:00 2015

Filename/Users/ap13/perl5/lib/perl5/darwin-2level/Class/MOP/MiniTrait.pm
StatementsExecuted 325 statements in 1.39ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
7661.10ms40.8msClass::MOP::MiniTrait::::applyClass::MOP::MiniTrait::apply
11123µs43µsClass::MOP::MiniTrait::::BEGIN@4Class::MOP::MiniTrait::BEGIN@4
11114µs40µsClass::MOP::MiniTrait::::BEGIN@7Class::MOP::MiniTrait::BEGIN@7
11113µs20µsClass::MOP::MiniTrait::::BEGIN@5Class::MOP::MiniTrait::BEGIN@5
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;
211µsour $VERSION = '2.1403';
3
4237µs264µs
# spent 43µs (23+20) within Class::MOP::MiniTrait::BEGIN@4 which was called: # once (23µs+20µs) by Class::MOP::Class::BEGIN@11 at line 4
use strict;
# spent 43µs making 1 call to Class::MOP::MiniTrait::BEGIN@4 # spent 20µs making 1 call to strict::import
5239µs226µs
# spent 20µs (13+7) within Class::MOP::MiniTrait::BEGIN@5 which was called: # once (13µs+7µs) by Class::MOP::Class::BEGIN@11 at line 5
use warnings;
# spent 20µs making 1 call to Class::MOP::MiniTrait::BEGIN@5 # spent 7µs making 1 call to warnings::import
6
72244µs266µs
# spent 40µs (14+26) within Class::MOP::MiniTrait::BEGIN@7 which was called: # once (14µs+26µs) by Class::MOP::Class::BEGIN@11 at line 7
use Module::Runtime 'use_package_optimistically';
# spent 40µs making 1 call to Class::MOP::MiniTrait::BEGIN@7 # spent 26µs making 1 call to Module::Runtime::import
8
9
# spent 40.8ms (1.10+39.7) within Class::MOP::MiniTrait::apply which was called 7 times, avg 5.84ms/call: # 2 times (710µs+29.2ms) by Class::MOP::Class::_immutable_metaclass at line 1371 of Class/MOP/Class.pm, avg 15.0ms/call # once (101µs+3.27ms) by parent::import at line 11 of Moose/Meta/Method.pm # once (100µs+2.76ms) by Moose::BEGIN@24 at line 24 of Moose/Meta/Class.pm # once (71µs+1.73ms) by Moose::Meta::TypeCoercion::BEGIN@8 at line 23 of Moose/Meta/Attribute.pm # once (60µs+1.40ms) by Moose::BEGIN@32 at line 24 of Moose/Meta/Role.pm # once (60µs+1.38ms) by Moose::BEGIN@28 at line 11 of Moose/Meta/Instance.pm
sub apply {
10713µs my ( $to_class, $trait ) = @_;
11
12726µs for ( grep { !ref } $to_class, $trait ) {
131225µs122.63ms use_package_optimistically($_);
# spent 2.63ms making 12 calls to Module::Runtime::use_package_optimistically, avg 219µs/call
141263µs122.76ms $_ = Class::MOP::Class->initialize($_);
# spent 2.76ms making 12 calls to Class::MOP::Class::initialize, avg 230µs/call
15 }
16
1793342µs935.02ms for my $meth ( grep { $_->package_name ne 'UNIVERSAL' } $trait->get_all_methods ) {
# spent 4.96ms making 7 calls to Class::MOP::Class::get_all_methods, avg 709µs/call # spent 54µs making 86 calls to Class::MOP::Method::package_name, avg 622ns/call
1858179µs5845µs my $meth_name = $meth->name;
# spent 45µs making 58 calls to Class::MOP::Method::name, avg 783ns/call
195834µs next if index($meth_name, '__') == 0; # skip private subs
20
2156332µs14227.7ms if ( $to_class->find_method_by_name($meth_name) ) {
# spent 14.7ms making 43 calls to Class::MOP::Class::add_around_method_modifier, avg 341µs/call # spent 13.0ms making 56 calls to Class::MOP::Class::find_method_by_name, avg 231µs/call # spent 35µs making 43 calls to Class::MOP::Method::body, avg 812ns/call
22 $to_class->add_around_method_modifier( $meth_name, $meth->body );
23 }
24 else {
251348µs261.63ms $to_class->add_method( $meth_name, $meth->clone );
# spent 1.29ms making 13 calls to Class::MOP::Mixin::HasMethods::add_method, avg 99µs/call # spent 341µs making 13 calls to Class::MOP::Method::clone, avg 26µ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.
341800nsrequire Class::MOP;
35
3615µs1;
37
38# ABSTRACT: Extremely limited trait application
39
40__END__