Filename | /usr/local/lib/perl/5.14.2/Moose/Meta/Method/Constructor.pm |
Statements | Executed 73 statements in 764µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
5 | 1 | 1 | 369µs | 31.9ms | new | Moose::Meta::Method::Constructor::
5 | 1 | 1 | 36µs | 31.5ms | _initialize_body | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 8µs | 8µs | BEGIN@3 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 7µs | 10µs | BEGIN@10 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 7µs | 36µs | BEGIN@16 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 7µs | 11µs | BEGIN@11 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 6µs | 43µs | BEGIN@15 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 6µs | 77µs | BEGIN@18 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 6µs | 32µs | BEGIN@14 | Moose::Meta::Method::Constructor::
1 | 1 | 1 | 3µs | 3µs | BEGIN@13 | Moose::Meta::Method::Constructor::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | |||||
2 | package Moose::Meta::Method::Constructor; | ||||
3 | # spent 8µs within Moose::Meta::Method::Constructor::BEGIN@3 which was called:
# once (8µs+0s) by Moose::Meta::Class::BEGIN@25 at line 5 | ||||
4 | 1 | 5µs | $Moose::Meta::Method::Constructor::AUTHORITY = 'cpan:STEVAN'; | ||
5 | 1 | 29µs | 1 | 8µs | } # spent 8µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@3 |
6 | { | ||||
7 | 2 | 1µs | $Moose::Meta::Method::Constructor::VERSION = '2.1005'; | ||
8 | } | ||||
9 | |||||
10 | 2 | 21µs | 2 | 13µs | # spent 10µs (7+3) within Moose::Meta::Method::Constructor::BEGIN@10 which was called:
# once (7µs+3µs) by Moose::Meta::Class::BEGIN@25 at line 10 # spent 10µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@10
# spent 3µs making 1 call to strict::import |
11 | 2 | 24µs | 2 | 16µs | # spent 11µs (7+5) within Moose::Meta::Method::Constructor::BEGIN@11 which was called:
# once (7µs+5µs) by Moose::Meta::Class::BEGIN@25 at line 11 # spent 11µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@11
# spent 5µs making 1 call to warnings::import |
12 | |||||
13 | 2 | 23µs | 1 | 3µs | # spent 3µs within Moose::Meta::Method::Constructor::BEGIN@13 which was called:
# once (3µs+0s) by Moose::Meta::Class::BEGIN@25 at line 13 # spent 3µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@13 |
14 | 2 | 27µs | 2 | 58µs | # spent 32µs (6+26) within Moose::Meta::Method::Constructor::BEGIN@14 which was called:
# once (6µs+26µs) by Moose::Meta::Class::BEGIN@25 at line 14 # spent 32µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@14
# spent 26µs making 1 call to Exporter::import |
15 | 2 | 22µs | 2 | 79µs | # spent 43µs (6+36) within Moose::Meta::Method::Constructor::BEGIN@15 which was called:
# once (6µs+36µs) by Moose::Meta::Class::BEGIN@25 at line 15 # spent 43µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@15
# spent 36µs making 1 call to Exporter::import |
16 | 2 | 26µs | 2 | 64µs | # spent 36µs (7+29) within Moose::Meta::Method::Constructor::BEGIN@16 which was called:
# once (7µs+29µs) by Moose::Meta::Class::BEGIN@25 at line 16 # spent 36µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@16
# spent 29µs making 1 call to Exporter::import |
17 | |||||
18 | 1 | 70µs | # spent 77µs (6+70) within Moose::Meta::Method::Constructor::BEGIN@18 which was called:
# once (6µs+70µs) by Moose::Meta::Class::BEGIN@25 at line 19 # spent 70µs making 1 call to base::import | ||
19 | 2 | 176µs | 1 | 77µs | 'Class::MOP::Method::Constructor'; # spent 77µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@18 |
20 | |||||
21 | # spent 31.9ms (369µs+31.5) within Moose::Meta::Method::Constructor::new which was called 5 times, avg 6.37ms/call:
# 5 times (369µs+31.5ms) by Class::MOP::Class::_inline_constructor at line 1438 of Class/MOP/Class.pm, avg 6.37ms/call | ||||
22 | 45 | 373µs | my $class = shift; | ||
23 | my %options = @_; | ||||
24 | |||||
25 | my $meta = $options{metaclass}; | ||||
26 | |||||
27 | (ref $options{options} eq 'HASH') | ||||
28 | || $class->throw_error("You must pass a hash of options", data => $options{options}); | ||||
29 | |||||
30 | ($options{package_name} && $options{name}) | ||||
31 | || $class->throw_error("You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT"); | ||||
32 | |||||
33 | my $self = bless { | ||||
34 | 'body' => undef, | ||||
35 | 'package_name' => $options{package_name}, | ||||
36 | 'name' => $options{name}, | ||||
37 | 'options' => $options{options}, | ||||
38 | 'associated_metaclass' => $meta, | ||||
39 | 'definition_context' => $options{definition_context}, | ||||
40 | '_expected_method_class' => $options{_expected_method_class} || 'Moose::Object', | ||||
41 | } => $class; | ||||
42 | |||||
43 | # we don't want this creating | ||||
44 | # a cycle in the code, if not | ||||
45 | # needed | ||||
46 | 5 | 5µs | weaken($self->{'associated_metaclass'}); # spent 5µs making 5 calls to Scalar::Util::weaken, avg 1µs/call | ||
47 | |||||
48 | 5 | 31.5ms | $self->_initialize_body; # spent 31.5ms making 5 calls to Moose::Meta::Method::Constructor::_initialize_body, avg 6.30ms/call | ||
49 | |||||
50 | return $self; | ||||
51 | } | ||||
52 | |||||
53 | ## method | ||||
54 | |||||
55 | # spent 31.5ms (36µs+31.5) within Moose::Meta::Method::Constructor::_initialize_body which was called 5 times, avg 6.30ms/call:
# 5 times (36µs+31.5ms) by Moose::Meta::Method::Constructor::new at line 48, avg 6.30ms/call | ||||
56 | 10 | 34µs | my $self = shift; | ||
57 | 5 | 31.5ms | $self->{'body'} = $self->_generate_constructor_method_inline; # spent 31.5ms making 5 calls to Class::MOP::Method::Constructor::_generate_constructor_method_inline, avg 6.29ms/call | ||
58 | } | ||||
59 | |||||
60 | 1 | 2µs | 1; | ||
61 | |||||
62 | # ABSTRACT: Method Meta Object for constructors | ||||
63 | |||||
64 | __END__ |