Filename | /usr/local/lib/perl/5.18.2/Moose/Meta/Method/Constructor.pm |
Statements | Executed 320 statements in 1.12ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
28 | 1 | 1 | 685µs | 125ms | new | Moose::Meta::Method::Constructor::
28 | 1 | 1 | 147µs | 125ms | _initialize_body | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 9µs | 18µs | BEGIN@4 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 7µs | 11µs | BEGIN@5 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 6µs | 36µs | BEGIN@7 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 6µs | 102µs | BEGIN@12 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 5µs | 33µs | BEGIN@9 | Moose::Meta::Method::Constructor::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moose::Meta::Method::Constructor; | ||||
2 | 1 | 600ns | our $VERSION = '2.1604'; | ||
3 | |||||
4 | 2 | 37µs | 2 | 26µs | # spent 18µs (9+9) within Moose::Meta::Method::Constructor::BEGIN@4 which was called:
# once (9µs+9µs) by Moose::Meta::Class::BEGIN@16 at line 4 # spent 18µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@4
# spent 9µs making 1 call to strict::import |
5 | 2 | 20µs | 2 | 15µs | # spent 11µs (7+4) within Moose::Meta::Method::Constructor::BEGIN@5 which was called:
# once (7µs+4µs) by Moose::Meta::Class::BEGIN@16 at line 5 # spent 11µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@5
# spent 4µs making 1 call to warnings::import |
6 | |||||
7 | 2 | 22µs | 2 | 67µs | # spent 36µs (6+30) within Moose::Meta::Method::Constructor::BEGIN@7 which was called:
# once (6µs+30µs) by Moose::Meta::Class::BEGIN@16 at line 7 # spent 36µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@7
# spent 30µs making 1 call to Exporter::import |
8 | |||||
9 | 1 | 3µs | 1 | 28µs | # spent 33µs (5+28) within Moose::Meta::Method::Constructor::BEGIN@9 which was called:
# once (5µs+28µs) by Moose::Meta::Class::BEGIN@16 at line 10 # spent 28µs making 1 call to parent::import |
10 | 1 | 20µs | 1 | 33µs | 'Class::MOP::Method::Constructor'; # spent 33µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@9 |
11 | |||||
12 | 2 | 154µs | 2 | 199µs | # spent 102µs (6+97) within Moose::Meta::Method::Constructor::BEGIN@12 which was called:
# once (6µs+97µs) by Moose::Meta::Class::BEGIN@16 at line 12 # spent 102µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@12
# spent 97µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337] |
13 | |||||
14 | # spent 125ms (685µs+125) within Moose::Meta::Method::Constructor::new which was called 28 times, avg 4.48ms/call:
# 28 times (685µs+125ms) by Class::MOP::Class::_inline_constructor at line 1453 of Class/MOP/Class.pm, avg 4.48ms/call | ||||
15 | 28 | 13µs | my $class = shift; | ||
16 | 28 | 69µs | my %options = @_; | ||
17 | |||||
18 | 28 | 16µs | my $meta = $options{metaclass}; | ||
19 | |||||
20 | 28 | 25µs | (ref $options{options} eq 'HASH') | ||
21 | || throw_exception( MustPassAHashOfOptions => params => \%options, | ||||
22 | class => $class | ||||
23 | ); | ||||
24 | |||||
25 | 28 | 17µs | ($options{package_name} && $options{name}) | ||
26 | || throw_exception( MustSupplyPackageNameAndName => params => \%options, | ||||
27 | class => $class | ||||
28 | ); | ||||
29 | |||||
30 | 28 | 150µs | my $self = bless { | ||
31 | 'body' => undef, | ||||
32 | 'package_name' => $options{package_name}, | ||||
33 | 'name' => $options{name}, | ||||
34 | 'options' => $options{options}, | ||||
35 | 'associated_metaclass' => $meta, | ||||
36 | 'definition_context' => $options{definition_context}, | ||||
37 | '_expected_method_class' => $options{_expected_method_class} || 'Moose::Object', | ||||
38 | } => $class; | ||||
39 | |||||
40 | # we don't want this creating | ||||
41 | # a cycle in the code, if not | ||||
42 | # needed | ||||
43 | 28 | 263µs | 28 | 31µs | weaken($self->{'associated_metaclass'}); # spent 31µs making 28 calls to Scalar::Util::weaken, avg 1µs/call |
44 | |||||
45 | 28 | 45µs | 28 | 125ms | $self->_initialize_body; # spent 125ms making 28 calls to Moose::Meta::Method::Constructor::_initialize_body, avg 4.45ms/call |
46 | |||||
47 | 28 | 102µs | return $self; | ||
48 | } | ||||
49 | |||||
50 | ## method | ||||
51 | |||||
52 | # spent 125ms (147µs+124) within Moose::Meta::Method::Constructor::_initialize_body which was called 28 times, avg 4.45ms/call:
# 28 times (147µs+124ms) by Moose::Meta::Method::Constructor::new at line 45, avg 4.45ms/call | ||||
53 | 28 | 8µs | my $self = shift; | ||
54 | 28 | 151µs | 28 | 124ms | $self->{'body'} = $self->_generate_constructor_method_inline; # spent 124ms making 28 calls to Class::MOP::Method::Constructor::_generate_constructor_method_inline, avg 4.45ms/call |
55 | } | ||||
56 | |||||
57 | 1 | 2µs | 1; | ||
58 | |||||
59 | # ABSTRACT: Method Meta Object for constructors | ||||
60 | |||||
61 | __END__ |