Filename | /usr/local/lib/perl/5.18.2/Moose/Meta/Method/Accessor/Native/Hash/set.pm |
Statements | Executed 85 statements in 631µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
3 | 1 | 1 | 25µs | 31µs | _inline_check_arguments | Moose::Meta::Method::Accessor::Native::Hash::set::
3 | 1 | 1 | 24µs | 33µs | _inline_coerce_new_values | Moose::Meta::Method::Accessor::Native::Hash::set::
6 | 2 | 2 | 19µs | 19µs | _return_value | Moose::Meta::Method::Accessor::Native::Hash::set::
1 | 1 | 1 | 14µs | 32µs | BEGIN@4 | Moose::Meta::Method::Accessor::Native::Hash::set::
3 | 1 | 1 | 11µs | 11µs | _inline_optimized_set_new_value | Moose::Meta::Method::Accessor::Native::Hash::set::
1 | 1 | 1 | 8µs | 6.25ms | BEGIN@8 | Moose::Meta::Method::Accessor::Native::Hash::set::
1 | 1 | 1 | 8µs | 90µs | BEGIN@101 | Moose::Meta::Method::Accessor::Native::Hash::set::
1 | 1 | 1 | 8µs | 17µs | BEGIN@5 | Moose::Meta::Method::Accessor::Native::Hash::set::
3 | 1 | 1 | 8µs | 8µs | _potential_value | Moose::Meta::Method::Accessor::Native::Hash::set::
3 | 1 | 1 | 5µs | 5µs | _inline_process_arguments | Moose::Meta::Method::Accessor::Native::Hash::set::
1 | 1 | 1 | 5µs | 5µs | BEGIN@7 | Moose::Meta::Method::Accessor::Native::Hash::set::
3 | 1 | 1 | 4µs | 4µs | _maximum_arguments | Moose::Meta::Method::Accessor::Native::Hash::set::
3 | 1 | 1 | 4µs | 4µs | _minimum_arguments | Moose::Meta::Method::Accessor::Native::Hash::set::
1 | 1 | 1 | 3µs | 3µs | _new_members | Moose::Meta::Method::Accessor::Native::Hash::set::
1 | 1 | 1 | 2µs | 2µs | _adds_members | Moose::Meta::Method::Accessor::Native::Hash::set::
0 | 0 | 0 | 0s | 0s | __ANON__[:29] | Moose::Meta::Method::Accessor::Native::Hash::set::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moose::Meta::Method::Accessor::Native::Hash::set; | ||||
2 | 1 | 900ns | our $VERSION = '2.1604'; | ||
3 | |||||
4 | 2 | 31µs | 2 | 50µs | # spent 32µs (14+18) within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@4 which was called:
# once (14µs+18µs) by Module::Runtime::require_module at line 4 # spent 32µs making 1 call to Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@4
# spent 18µs making 1 call to strict::import |
5 | 2 | 23µs | 2 | 25µs | # spent 17µs (8+9) within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@5 which was called:
# once (8µs+9µs) by Module::Runtime::require_module at line 5 # spent 17µs making 1 call to Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@5
# spent 9µs making 1 call to warnings::import |
6 | |||||
7 | 2 | 23µs | 1 | 5µs | # spent 5µs within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@7 which was called:
# once (5µs+0s) by Module::Runtime::require_module at line 7 # spent 5µs making 1 call to Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@7 |
8 | 2 | 351µs | 2 | 12.5ms | # spent 6.25ms (8µs+6.24) within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@8 which was called:
# once (8µs+6.24ms) by Module::Runtime::require_module at line 8 # spent 6.25ms making 1 call to Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@8
# spent 6.24ms making 1 call to Moose::Role::import |
9 | |||||
10 | 1 | 11µs | 1 | 25.2ms | with 'Moose::Meta::Method::Accessor::Native::Hash::Writer'; # spent 25.2ms making 1 call to Moose::Role::with |
11 | |||||
12 | 3 | 7µs | # spent 4µs within Moose::Meta::Method::Accessor::Native::Hash::set::_minimum_arguments which was called 3 times, avg 1µs/call:
# 3 times (4µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 74 of Moose/Meta/Method/Accessor/Native.pm, avg 1µs/call | ||
13 | |||||
14 | 3 | 6µs | # spent 4µs within Moose::Meta::Method::Accessor::Native::Hash::set::_maximum_arguments which was called 3 times, avg 1µs/call:
# 3 times (4µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 85 of Moose/Meta/Method/Accessor/Native.pm, avg 1µs/call | ||
15 | |||||
16 | around _inline_check_argument_count => sub { | ||||
17 | 3 | 1µs | my $orig = shift; | ||
18 | 3 | 900ns | my $self = shift; | ||
19 | |||||
20 | return ( | ||||
21 | 3 | 20µs | 9 | 86µs | $self->$orig(@_), # spent 80µs making 3 calls to Moose::Meta::Method::Accessor::Native::_inline_check_argument_count, avg 27µs/call
# spent 4µs making 3 calls to Class::MOP::Method::Accessor::_inline_throw_exception, avg 1µs/call
# spent 2µs making 3 calls to Moose::Meta::Method::Delegation::delegate_to_method, avg 833ns/call |
22 | 'if (@_ % 2) {', | ||||
23 | $self->_inline_throw_exception( MustPassEvenNumberOfArguments => | ||||
24 | "method_name => '".$self->delegate_to_method."',". | ||||
25 | 'args => \@_', | ||||
26 | ) . ';', | ||||
27 | '}', | ||||
28 | ); | ||||
29 | 1 | 6µs | 1 | 41µs | }; # spent 41µs making 1 call to Moose::Role::around |
30 | |||||
31 | # spent 5µs within Moose::Meta::Method::Accessor::Native::Hash::set::_inline_process_arguments which was called 3 times, avg 2µs/call:
# 3 times (5µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 39 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 2µs/call | ||||
32 | 3 | 800ns | my $self = shift; | ||
33 | |||||
34 | return ( | ||||
35 | 3 | 7µs | 'my @keys_idx = grep { ! ($_ % 2) } 0..$#_;', | ||
36 | 'my @values_idx = grep { $_ % 2 } 0..$#_;', | ||||
37 | ); | ||||
38 | } | ||||
39 | |||||
40 | # spent 31µs (25+6) within Moose::Meta::Method::Accessor::Native::Hash::set::_inline_check_arguments which was called 3 times, avg 10µs/call:
# 3 times (25µs+6µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 39 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 10µs/call | ||||
41 | 3 | 900ns | my $self = shift; | ||
42 | |||||
43 | return ( | ||||
44 | 3 | 16µs | 6 | 6µs | 'for (@keys_idx) {', # spent 4µs making 3 calls to Class::MOP::Method::Accessor::_inline_throw_exception, avg 2µs/call
# spent 2µs making 3 calls to Moose::Meta::Method::Delegation::delegate_to_method, avg 567ns/call |
45 | 'if (!defined($_[$_])) {', | ||||
46 | $self->_inline_throw_exception( UndefinedHashKeysPassedToMethod => | ||||
47 | 'hash_keys => \@keys_idx,'. | ||||
48 | "method_name => '".$self->delegate_to_method."'", | ||||
49 | ) . ';', | ||||
50 | '}', | ||||
51 | '}', | ||||
52 | ); | ||||
53 | } | ||||
54 | |||||
55 | 1 | 6µs | # spent 2µs within Moose::Meta::Method::Accessor::Native::Hash::set::_adds_members which was called:
# once (2µs+0s) by Moose::Meta::Method::Accessor::Native::Collection::_inline_tc_code at line 59 of Moose/Meta/Method/Accessor/Native/Collection.pm | ||
56 | |||||
57 | # We need to override this because while @_ can be written to, we cannot write | ||||
58 | # directly to $_[1]. | ||||
59 | # spent 33µs (24+9) within Moose::Meta::Method::Accessor::Native::Hash::set::_inline_coerce_new_values which was called 3 times, avg 11µs/call:
# 3 times (24µs+9µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 52 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 11µs/call | ||||
60 | 3 | 2µs | my $self = shift; | ||
61 | |||||
62 | 3 | 16µs | 6 | 9µs | return unless $self->associated_attribute->should_coerce; # spent 4µs making 3 calls to Moose::Meta::Mixin::AttributeCore::should_coerce, avg 1µs/call
# spent 4µs making 3 calls to Class::MOP::Method::Accessor::associated_attribute, avg 1µs/call |
63 | |||||
64 | return unless $self->_tc_member_type_can_coerce; | ||||
65 | |||||
66 | # Is there a simpler way to do this? | ||||
67 | return ( | ||||
68 | 'my $iter = List::MoreUtils::natatime(2, @_);', | ||||
69 | '@_ = ();', | ||||
70 | 'while (my ($key, $val) = $iter->()) {', | ||||
71 | 'push @_, $key, $member_coercion->($val);', | ||||
72 | '}', | ||||
73 | ); | ||||
74 | }; | ||||
75 | |||||
76 | # spent 8µs within Moose::Meta::Method::Accessor::Native::Hash::set::_potential_value which was called 3 times, avg 3µs/call:
# 3 times (8µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 35 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 3µs/call | ||||
77 | 3 | 700ns | my $self = shift; | ||
78 | 3 | 1µs | my ($slot_access) = @_; | ||
79 | |||||
80 | 3 | 10µs | return '{ %{ (' . $slot_access . ') }, @_ }'; | ||
81 | } | ||||
82 | |||||
83 | 1 | 5µs | # spent 3µs within Moose::Meta::Method::Accessor::Native::Hash::set::_new_members which was called:
# once (3µs+0s) by Moose::Meta::Method::Accessor::Native::Collection::_inline_tc_code at line 61 of Moose/Meta/Method/Accessor/Native/Collection.pm | ||
84 | |||||
85 | # spent 11µs within Moose::Meta::Method::Accessor::Native::Hash::set::_inline_optimized_set_new_value which was called 3 times, avg 4µs/call:
# 3 times (11µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value at line 150 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 4µs/call | ||||
86 | 3 | 1µs | my $self = shift; | ||
87 | 3 | 3µs | my ($inv, $new, $slot_access) = @_; | ||
88 | |||||
89 | 3 | 11µs | return '@{ (' . $slot_access . ') }{ @_[@keys_idx] } = @_[@values_idx];'; | ||
90 | } | ||||
91 | |||||
92 | # spent 19µs within Moose::Meta::Method::Accessor::Native::Hash::set::_return_value which was called 6 times, avg 3µs/call:
# 3 times (13µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 46 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 4µs/call
# 3 times (7µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_return_value at line 103 of Moose/Meta/Method/Accessor/Native.pm, avg 2µs/call | ||||
93 | 6 | 2µs | my $self = shift; | ||
94 | 6 | 2µs | my ($slot_access) = @_; | ||
95 | |||||
96 | 6 | 24µs | return 'wantarray ' | ||
97 | . '? @{ (' . $slot_access . ') }{ @_[@keys_idx] } ' | ||||
98 | . ': ' . $slot_access . '->{ $_[$keys_idx[0]] }'; | ||||
99 | } | ||||
100 | |||||
101 | 2 | 30µs | 2 | 172µs | # spent 90µs (8+82) within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@101 which was called:
# once (8µs+82µs) by Module::Runtime::require_module at line 101 # spent 90µs making 1 call to Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@101
# spent 82µs making 1 call to Moose::Role::unimport |
102 | |||||
103 | 1 | 11µs | 1; |