← 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:45:25 2015

Filename/Users/ap13/perl5/lib/perl5/darwin-2level/Class/MOP/Method/Constructor.pm
StatementsExecuted 1042 statements in 5.49ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
46222.39ms169msClass::MOP::Method::Constructor::::_generate_constructor_method_inlineClass::MOP::Method::Constructor::_generate_constructor_method_inline
3011707µs57.1msClass::MOP::Method::Constructor::::newClass::MOP::Method::Constructor::new
3011538µs538µsClass::MOP::Method::Constructor::::_newClass::MOP::Method::Constructor::_new
4611336µs21.5msClass::MOP::Method::Constructor::::_eval_environmentClass::MOP::Method::Constructor::_eval_environment
3011248µs55.7msClass::MOP::Method::Constructor::::_initialize_bodyClass::MOP::Method::Constructor::_initialize_body
11124µs52µsClass::MOP::Method::Constructor::::BEGIN@4Class::MOP::Method::Constructor::BEGIN@4
11114µs65µsClass::MOP::Method::Constructor::::BEGIN@8Class::MOP::Method::Constructor::BEGIN@8
11114µs24µsClass::MOP::Method::Constructor::::BEGIN@5Class::MOP::Method::Constructor::BEGIN@5
11113µs68µsClass::MOP::Method::Constructor::::BEGIN@7Class::MOP::Method::Constructor::BEGIN@7
11112µs986µsClass::MOP::Method::Constructor::::BEGIN@10Class::MOP::Method::Constructor::BEGIN@10
0000s0sClass::MOP::Method::Constructor::::__ANON__[:108]Class::MOP::Method::Constructor::__ANON__[:108]
0000s0sClass::MOP::Method::Constructor::::__ANON__[:115]Class::MOP::Method::Constructor::__ANON__[:115]
0000s0sClass::MOP::Method::Constructor::::__ANON__[:90]Class::MOP::Method::Constructor::__ANON__[:90]
0000s0sClass::MOP::Method::Constructor::::_generate_constructor_methodClass::MOP::Method::Constructor::_generate_constructor_method
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::Method::Constructor;
211µsour $VERSION = '2.1403';
3
4240µs279µs
# spent 52µs (24+27) within Class::MOP::Method::Constructor::BEGIN@4 which was called: # once (24µs+27µs) by Class::MOP::Class::BEGIN@10 at line 4
use strict;
# spent 52µs making 1 call to Class::MOP::Method::Constructor::BEGIN@4 # spent 27µs making 1 call to strict::import
5242µs234µs
# spent 24µs (14+10) within Class::MOP::Method::Constructor::BEGIN@5 which was called: # once (14µs+10µs) by Class::MOP::Class::BEGIN@10 at line 5
use warnings;
# spent 24µs making 1 call to Class::MOP::Method::Constructor::BEGIN@5 # spent 10µs making 1 call to warnings::import
6
7240µs2122µs
# spent 68µs (13+54) within Class::MOP::Method::Constructor::BEGIN@7 which was called: # once (13µs+54µs) by Class::MOP::Class::BEGIN@10 at line 7
use Scalar::Util 'blessed', 'weaken';
# spent 68µs making 1 call to Class::MOP::Method::Constructor::BEGIN@7 # spent 54µs making 1 call to Exporter::import
8243µs2116µs
# spent 65µs (14+51) within Class::MOP::Method::Constructor::BEGIN@8 which was called: # once (14µs+51µs) by Class::MOP::Class::BEGIN@10 at line 8
use Try::Tiny;
# spent 65µs making 1 call to Class::MOP::Method::Constructor::BEGIN@8 # spent 51µs making 1 call to Exporter::import
9
102760µs21.96ms
# spent 986µs (12+974) within Class::MOP::Method::Constructor::BEGIN@10 which was called: # once (12µs+974µs) by Class::MOP::Class::BEGIN@10 at line 10
use parent 'Class::MOP::Method::Inlined';
# spent 986µs making 1 call to Class::MOP::Method::Constructor::BEGIN@10 # spent 974µs making 1 call to parent::import
11
12
# spent 57.1ms (707µs+56.4) within Class::MOP::Method::Constructor::new which was called 30 times, avg 1.90ms/call: # 30 times (707µs+56.4ms) by Class::MOP::Class::_inline_constructor at line 1453 of Class/MOP/Class.pm, avg 1.90ms/call
sub new {
13240740µs my $class = shift;
14 my %options = @_;
15
166069µs (blessed $options{metaclass} && $options{metaclass}->isa('Class::MOP::Class'))
# spent 36µs making 30 calls to Scalar::Util::blessed, avg 1µs/call # spent 34µs making 30 calls to UNIVERSAL::isa, avg 1µs/call
17 || $class->_throw_exception( MustSupplyAMetaclass => params => \%options,
18 class => $class
19 )
20 if $options{is_inline};
21
22 ($options{package_name} && $options{name})
23 || $class->_throw_exception( MustSupplyPackageNameAndName => params => \%options,
24 class => $class
25 );
26
2730538µs my $self = $class->_new(\%options);
# spent 538µs making 30 calls to Class::MOP::Method::Constructor::_new, avg 18µs/call
28
29 # we don't want this creating
30 # a cycle in the code, if not
31 # needed
323033µs weaken($self->{'associated_metaclass'});
# spent 33µs making 30 calls to Scalar::Util::weaken, avg 1µs/call
33
343055.7ms $self->_initialize_body;
# spent 55.7ms making 30 calls to Class::MOP::Method::Constructor::_initialize_body, avg 1.86ms/call
35
36 return $self;
37}
38
39
# spent 538µs within Class::MOP::Method::Constructor::_new which was called 30 times, avg 18µs/call: # 30 times (538µs+0s) by Class::MOP::Method::Constructor::new at line 27, avg 18µs/call
sub _new {
40120570µs my $class = shift;
41
42 return Class::MOP::Class->initialize($class)->new_object(@_)
43 if $class ne __PACKAGE__;
44
45 my $params = @_ == 1 ? $_[0] : {@_};
46
47 return bless {
48 # inherited from Class::MOP::Method
49 body => $params->{body},
50 # associated_metaclass => $params->{associated_metaclass}, # overridden
51 package_name => $params->{package_name},
52 name => $params->{name},
53 original_method => $params->{original_method},
54
55 # inherited from Class::MOP::Generated
56 is_inline => $params->{is_inline} || 0,
57 definition_context => $params->{definition_context},
58
59 # inherited from Class::MOP::Inlined
60 _expected_method_class => $params->{_expected_method_class},
61
62 # defined in this subclass
63 options => $params->{options} || {},
64 associated_metaclass => $params->{metaclass},
65 }, $class;
66}
67
68## accessors
69
7046157µssub options { (shift)->{'options'} }
7190231µssub associated_metaclass { (shift)->{'associated_metaclass'} }
72
73## method
74
75
# spent 55.7ms (248µs+55.5) within Class::MOP::Method::Constructor::_initialize_body which was called 30 times, avg 1.86ms/call: # 30 times (248µs+55.5ms) by Class::MOP::Method::Constructor::new at line 34, avg 1.86ms/call
sub _initialize_body {
76120252µs my $self = shift;
77 my $method_name = '_generate_constructor_method';
78
793021µs $method_name .= '_inline' if $self->is_inline;
# spent 21µs making 30 calls to Class::MOP::Method::Generated::is_inline, avg 703ns/call
80
813055.5ms $self->{'body'} = $self->$method_name;
# spent 55.5ms making 30 calls to Class::MOP::Method::Constructor::_generate_constructor_method_inline, avg 1.85ms/call
82}
83
84
# spent 21.5ms (336µs+21.2) within Class::MOP::Method::Constructor::_eval_environment which was called 46 times, avg 467µs/call: # 46 times (336µs+21.2ms) by Class::MOP::Method::Generated::_compile_code at line 52 of Class/MOP/Method/Generated.pm, avg 467µs/call
sub _eval_environment {
8592254µs my $self = shift;
869221.2ms return $self->associated_metaclass->_eval_environment;
# spent 14.9ms making 16 calls to Moose::Meta::Class::_eval_environment, avg 931µs/call # spent 6.18ms making 30 calls to Class::MOP::Class::_eval_environment, avg 206µs/call # spent 41µs making 30 calls to Class::MOP::Method::Constructor::associated_metaclass, avg 1µs/call # spent 38µs making 16 calls to Class::MOP::Method::associated_metaclass, avg 2µs/call
87}
88
89sub _generate_constructor_method {
90 return sub { Class::MOP::Class->initialize(shift)->new_object(@_) }
91}
92
93
# spent 169ms (2.39+166) within Class::MOP::Method::Constructor::_generate_constructor_method_inline which was called 46 times, avg 3.67ms/call: # 30 times (1.20ms+54.3ms) by Class::MOP::Method::Constructor::_initialize_body at line 81, avg 1.85ms/call # 16 times (1.19ms+112ms) by Moose::Meta::Method::Constructor::_initialize_body at line 54 of Moose/Meta/Method/Constructor.pm, avg 7.09ms/call
sub _generate_constructor_method_inline {
942762.17ms my $self = shift;
95
964675µs my $meta = $self->associated_metaclass;
# spent 39µs making 16 calls to Class::MOP::Method::associated_metaclass, avg 2µs/call # spent 36µs making 30 calls to Class::MOP::Method::Constructor::associated_metaclass, avg 1µs/call
97
9846100ms my @source = (
# spent 100ms making 46 calls to Class::MOP::Class::_inline_new_object, avg 2.18ms/call
99 'sub {',
100 $meta->_inline_new_object,
101 '}',
102 );
103
10446103µs warn join("\n", @source) if $self->options->{debug};
# spent 103µs making 46 calls to Class::MOP::Method::Constructor::options, avg 2µs/call
105
106 my $code = try {
10746187µs4664.3ms $self->_compile_code(\@source);
# spent 64.3ms making 46 calls to Class::MOP::Method::Generated::_compile_code, avg 1.40ms/call
108 }
109 catch {
110 my $source = join("\n", @source);
111 $self->_throw_exception( CouldNotEvalConstructor => constructor_method => $self,
112 source => $source,
113 error => $_
114 );
1159266.2ms };
# spent 65.9ms making 46 calls to Try::Tiny::try, avg 1.43ms/call # spent 226µs making 46 calls to Try::Tiny::catch, avg 5µs/call
116
117 return $code;
118}
119
12015µs1;
121
122# ABSTRACT: Method Meta Object for constructors
123
124__END__