← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:45:08 2010
Reported on Wed Nov 17 22:10:11 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/Method/Accessor/Native/Hash/set.pm
StatementsExecuted 69 statements in 3.14ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
211131µs157µsMoose::Meta::Method::Accessor::Native::Hash::set::::_inline_check_argumentsMoose::Meta::Method::Accessor::Native::Hash::set::_inline_check_arguments
11178µs96µsMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@3Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@3
42167µs67µsMoose::Meta::Method::Accessor::Native::Hash::set::::_return_valueMoose::Meta::Method::Accessor::Native::Hash::set::_return_value
11147µs808µsMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@100Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@100
11145µs15.3msMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@13Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@13
21142µs42µsMoose::Meta::Method::Accessor::Native::Hash::set::::_inline_optimized_set_new_valueMoose::Meta::Method::Accessor::Native::Hash::set::_inline_optimized_set_new_value
11140µs228µsMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@7Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@7
11139µs107µsMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@4Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@4
21132µs32µsMoose::Meta::Method::Accessor::Native::Hash::set::::_potential_valueMoose::Meta::Method::Accessor::Native::Hash::set::_potential_value
21125µs25µsMoose::Meta::Method::Accessor::Native::Hash::set::::_inline_process_argumentsMoose::Meta::Method::Accessor::Native::Hash::set::_inline_process_arguments
11120µs20µsMoose::Meta::Method::Accessor::Native::Hash::set::::BEGIN@6Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@6
21119µs19µsMoose::Meta::Method::Accessor::Native::Hash::set::::_adds_membersMoose::Meta::Method::Accessor::Native::Hash::set::_adds_members
21118µs18µsMoose::Meta::Method::Accessor::Native::Hash::set::::_minimum_argumentsMoose::Meta::Method::Accessor::Native::Hash::set::_minimum_arguments
21118µs18µsMoose::Meta::Method::Accessor::Native::Hash::set::::_new_membersMoose::Meta::Method::Accessor::Native::Hash::set::_new_members
21117µs17µsMoose::Meta::Method::Accessor::Native::Hash::set::::_maximum_argumentsMoose::Meta::Method::Accessor::Native::Hash::set::_maximum_arguments
0000s0sMoose::Meta::Method::Accessor::Native::Hash::set::::__ANON__[:41]Moose::Meta::Method::Accessor::Native::Hash::set::__ANON__[:41]
0000s0sMoose::Meta::Method::Accessor::Native::Hash::set::::__ANON__[:78]Moose::Meta::Method::Accessor::Native::Hash::set::__ANON__[:78]
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;
2
33102µs2115µs
# spent 96µs (78+18) within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@3 which was called: # once (78µs+18µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 3
use strict;
# spent 96µs making 1 call to Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@3 # spent 18µs making 1 call to strict::import
4396µs2174µs
# spent 107µs (39+67) within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@4 which was called: # once (39µs+67µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 4
use warnings;
# spent 107µs making 1 call to Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@4 # spent 67µs making 1 call to warnings::import
5
63174µs120µs
# spent 20µs within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@6 which was called: # once (20µs+0s) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 6
use List::MoreUtils ();
73229µs2416µs
# spent 228µs (40+188) within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@7 which was called: # once (40µs+188µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 7
use Scalar::Util qw( looks_like_number );
# spent 228µs making 1 call to Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@7 # spent 188µs making 1 call to Exporter::import
8
914µsour $VERSION = '1.19';
10177µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
1113µsour $AUTHORITY = 'cpan:STEVAN';
12
1331.50ms230.6ms
# spent 15.3ms (45µs+15.3) within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@13 which was called: # once (45µs+15.3ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 13
use Moose::Role;
14
15140µs1234mswith 'Moose::Meta::Method::Accessor::Native::Hash::Writer' => {
# spent 234ms making 1 call to Moose::Role::with
16 -excludes => [
17 qw(
18 _minimum_arguments
19 _maximum_arguments
20 _inline_process_arguments
21 _inline_check_arguments
22 _inline_optimized_set_new_value
23 _return_value
24 )
25 ],
26};
27
28230µs
# spent 18µs within Moose::Meta::Method::Accessor::Native::Hash::set::_minimum_arguments which was called 2 times, avg 9µs/call: # 2 times (18µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 66 of Moose/Meta/Method/Accessor/Native.pm, avg 9µs/call
sub _minimum_arguments { 2 }
29
30228µs
# spent 17µs within Moose::Meta::Method::Accessor::Native::Hash::set::_maximum_arguments which was called 2 times, avg 9µs/call: # 2 times (17µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 80 of Moose/Meta/Method/Accessor/Native.pm, avg 9µs/call
sub _maximum_arguments { undef }
31
32around _inline_check_argument_count => sub {
33677µs my $orig = shift;
34 my $self = shift;
35
36 return
374348µs $self->$orig(@_) . "\n"
# spent 320µs making 2 calls to Moose::Meta::Method::Accessor::Native::_inline_check_argument_count, avg 160µs/call # spent 28µs making 2 calls to Moose::Meta::Method::_inline_throw_error, avg 14µs/call
38 . $self->_inline_throw_error(
39 q{'You must pass an even number of arguments to set'})
40 . ' if @_ % 2;';
41124µs1312µs};
# spent 312µs making 1 call to Moose::Role::around
42
43
# spent 25µs within Moose::Meta::Method::Accessor::Native::Hash::set::_inline_process_arguments which was called 2 times, avg 12µs/call: # 2 times (25µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 48 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 12µs/call
sub _inline_process_arguments {
44437µs my $self = shift;
45
46 return 'my @keys_idx = grep { ! ($_ % 2) } 0..$#_;' . "\n"
47 . 'my @values_idx = grep { $_ % 2 } 0..$#_;';
48}
49
50
# spent 157µs (131+26) within Moose::Meta::Method::Accessor::Native::Hash::set::_inline_check_arguments which was called 2 times, avg 79µs/call: # 2 times (131µs+26µs) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 49 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 79µs/call
sub _inline_check_arguments {
514131µs my $self = shift;
52
53 return
54226µs 'for (@keys_idx) {' . "\n"
# spent 26µs making 2 calls to Moose::Meta::Method::_inline_throw_error, avg 13µs/call
55 . $self->_inline_throw_error(
56 q{'Hash keys passed to set must be defined'})
57 . ' unless defined $_[$_];' . "\n" . '}';
58}
59
60228µs
# spent 19µs within Moose::Meta::Method::Accessor::Native::Hash::set::_adds_members which was called 2 times, avg 9µs/call: # 2 times (19µs+0s) by Class::MOP::Class:::around at line 68 of Moose/Meta/Method/Accessor/Native/Collection.pm, avg 9µs/call
sub _adds_members { 1 }
61
62# We need to override this because while @_ can be written to, we cannot write
63# directly to $_[1].
64around _inline_coerce_new_values => sub {
656109µs shift;
66 my $self = shift;
67
68442µs return q{} unless $self->associated_attribute->should_coerce;
# spent 26µs making 2 calls to Moose::Meta::Mixin::AttributeCore::should_coerce, avg 13µs/call # spent 16µs making 2 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call
69
70 return q{} unless $self->_tc_member_type_can_coerce;
71
72 # Is there a simpler way to do this?
73 return 'my $iter = List::MoreUtils::natatime 2, @_;'
74 . '@_ = ();'
75 . 'while ( my ( $key, $val ) = $iter->() ) {'
76 . 'push @_, $key, $member_tc_obj->coerce($val);'
77 . '}';
78120µs1251µs};
# spent 251µs making 1 call to Moose::Role::around
79
80
# spent 32µs within Moose::Meta::Method::Accessor::Native::Hash::set::_potential_value which was called 2 times, avg 16µs/call: # 2 times (32µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 53 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 16µs/call
sub _potential_value {
81444µs my ( $self, $slot_access ) = @_;
82
83 return "{ %{ ($slot_access) }, \@_ }";
84}
85
86227µs
# spent 18µs within Moose::Meta::Method::Accessor::Native::Hash::set::_new_members which was called 2 times, avg 9µs/call: # 2 times (18µs+0s) by Class::MOP::Class:::around at line 70 of Moose/Meta/Method/Accessor/Native/Collection.pm, avg 9µs/call
sub _new_members { '@_[ @values_idx ]' }
87
88
# spent 42µs within Moose::Meta::Method::Accessor::Native::Hash::set::_inline_optimized_set_new_value which was called 2 times, avg 21µs/call: # 2 times (42µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value at line 166 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 21µs/call
sub _inline_optimized_set_new_value {
89453µs my ( $self, $inv, $new, $slot_access ) = @_;
90
91 return "\@{ ($slot_access) }{ \@_[ \@keys_idx] } = \@_[ \@values_idx ]";
92}
93
94
# spent 67µs within Moose::Meta::Method::Accessor::Native::Hash::set::_return_value which was called 4 times, avg 17µs/call: # 2 times (35µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 55 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 18µs/call # 2 times (32µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 78 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 16µs/call
sub _return_value {
95889µs my ( $self, $slot_access ) = @_;
96
97 return "return wantarray ? \@{ ($slot_access) }{ \@_[ \@keys_idx ] } : ${slot_access}->{ \$_[ \$keys_idx[0] ] };";
98}
99
1003125µs21.57ms
# spent 808µs (47+761) within Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@100 which was called: # once (47µs+761µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 100
no Moose::Role;
101
102186µs1;