← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:11 2016

Filename/usr/local/lib/perl/5.18.2/Moose/Meta/Method/Accessor/Native/Hash/set.pm
StatementsExecuted 85 statements in 631µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
31125µs31µsMoose::Meta::Method::Accessor::Native::Hash::set::::_inline_check_argumentsMoose::Meta::Method::Accessor::Native::Hash::set::_inline_check_arguments
31124µs33µsMoose::Meta::Method::Accessor::Native::Hash::set::::_inline_coerce_new_valuesMoose::Meta::Method::Accessor::Native::Hash::set::_inline_coerce_new_values
62219µs19µsMoose::Meta::Method::Accessor::Native::Hash::set::::_return_valueMoose::Meta::Method::Accessor::Native::Hash::set::_return_value
11114µs32µsMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@4Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@4
31111µs11µsMoose::Meta::Method::Accessor::Native::Hash::set::::_inline_optimized_set_new_valueMoose::Meta::Method::Accessor::Native::Hash::set::_inline_optimized_set_new_value
1118µs6.25msMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@8Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@8
1118µs90µsMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@101Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@101
1118µs17µsMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@5Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@5
3118µs8µsMoose::Meta::Method::Accessor::Native::Hash::set::::_potential_valueMoose::Meta::Method::Accessor::Native::Hash::set::_potential_value
3115µs5µsMoose::Meta::Method::Accessor::Native::Hash::set::::_inline_process_argumentsMoose::Meta::Method::Accessor::Native::Hash::set::_inline_process_arguments
1115µs5µsMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@7Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@7
3114µs4µsMoose::Meta::Method::Accessor::Native::Hash::set::::_maximum_argumentsMoose::Meta::Method::Accessor::Native::Hash::set::_maximum_arguments
3114µs4µsMoose::Meta::Method::Accessor::Native::Hash::set::::_minimum_argumentsMoose::Meta::Method::Accessor::Native::Hash::set::_minimum_arguments
1113µs3µsMoose::Meta::Method::Accessor::Native::Hash::set::::_new_membersMoose::Meta::Method::Accessor::Native::Hash::set::_new_members
1112µs2µsMoose::Meta::Method::Accessor::Native::Hash::set::::_adds_membersMoose::Meta::Method::Accessor::Native::Hash::set::_adds_members
0000s0sMoose::Meta::Method::Accessor::Native::Hash::set::::__ANON__[:29]Moose::Meta::Method::Accessor::Native::Hash::set::__ANON__[:29]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Meta::Method::Accessor::Native::Hash::set;
21900nsour $VERSION = '2.1604';
3
4231µs250µ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
use strict;
# 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
5223µs225µ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
use warnings;
# 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
7223µs15µ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
use List::MoreUtils ();
82351µs212.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
use Moose::Role;
# 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
10111µs125.2mswith 'Moose::Meta::Method::Accessor::Native::Hash::Writer';
# spent 25.2ms making 1 call to Moose::Role::with
11
1237µ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
sub _minimum_arguments { 2 }
13
1436µ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
sub _maximum_arguments { undef }
15
16around _inline_check_argument_count => sub {
1731µs my $orig = shift;
183900ns my $self = shift;
19
20 return (
21320µs986µ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 );
2916µs141µ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
sub _inline_process_arguments {
323800ns my $self = shift;
33
34 return (
3537µ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
sub _inline_check_arguments {
413900ns my $self = shift;
42
43 return (
44316µs66µ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
5516µ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
sub _adds_members { 1 }
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
sub _inline_coerce_new_values {
6032µs my $self = shift;
61
62316µs69µ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
sub _potential_value {
773700ns my $self = shift;
7831µs my ($slot_access) = @_;
79
80310µs return '{ %{ (' . $slot_access . ') }, @_ }';
81}
82
8315µ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
sub _new_members { '@_[ @values_idx ]' }
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
sub _inline_optimized_set_new_value {
8631µs my $self = shift;
8733µs my ($inv, $new, $slot_access) = @_;
88
89311µ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
sub _return_value {
9362µs my $self = shift;
9462µs my ($slot_access) = @_;
95
96624µs return 'wantarray '
97 . '? @{ (' . $slot_access . ') }{ @_[@keys_idx] } '
98 . ': ' . $slot_access . '->{ $_[$keys_idx[0]] }';
99}
100
101230µs2172µ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
no Moose::Role;
# 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
103111µs1;