← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/pan_genome_post_analysis
  Run on Fri Mar 27 11:43:32 2015
Reported on Fri Mar 27 11:45:52 2015

Filename/Users/ap13/perl5/lib/perl5/Graph/Attribute.pm
StatementsExecuted 70 statements in 1.08ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11192µs115µsGraph::Attribute::::importGraph::Attribute::import
21144µs52µsGraph::Attribute::::get_attributeGraph::Attribute::get_attribute
21144µs63µsGraph::Attribute::::set_attributeGraph::Attribute::set_attribute
101122µs22µsGraph::Attribute::::CORE:matchGraph::Attribute::CORE:match (opcode)
21119µs19µsGraph::Attribute::::__ANON__[:19]Graph::Attribute::__ANON__[:19]
11115µs36µsGraph::Attribute::::BEGIN@3Graph::Attribute::BEGIN@3
1118µs19µsGraph::Attribute::::BEGIN@14Graph::Attribute::BEGIN@14
1118µs19µsGraph::Attribute::::BEGIN@24Graph::Attribute::BEGIN@24
1118µs18µsGraph::Attribute::::BEGIN@49Graph::Attribute::BEGIN@49
2118µs8µsGraph::Attribute::::__ANON__[:15]Graph::Attribute::__ANON__[:15]
0000s0sGraph::Attribute::::__ANON__[:20]Graph::Attribute::__ANON__[:20]
0000s0sGraph::Attribute::::__ANON__[:21]Graph::Attribute::__ANON__[:21]
0000s0sGraph::Attribute::::__ANON__[:25]Graph::Attribute::__ANON__[:25]
0000s0sGraph::Attribute::::__ANON__[:29]Graph::Attribute::__ANON__[:29]
0000s0sGraph::Attribute::::__ANON__[:30]Graph::Attribute::__ANON__[:30]
0000s0sGraph::Attribute::::__ANON__[:31]Graph::Attribute::__ANON__[:31]
0000s0sGraph::Attribute::::delete_attributeGraph::Attribute::delete_attribute
0000s0sGraph::Attribute::::delete_attributesGraph::Attribute::delete_attributes
0000s0sGraph::Attribute::::get_attribute_namesGraph::Attribute::get_attribute_names
0000s0sGraph::Attribute::::get_attribute_valuesGraph::Attribute::get_attribute_values
0000s0sGraph::Attribute::::get_attributesGraph::Attribute::get_attributes
0000s0sGraph::Attribute::::has_attributeGraph::Attribute::has_attribute
0000s0sGraph::Attribute::::has_attributesGraph::Attribute::has_attributes
0000s0sGraph::Attribute::::set_attributesGraph::Attribute::set_attributes
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Graph::Attribute;
2
3280µs257µs
# spent 36µs (15+21) within Graph::Attribute::BEGIN@3 which was called: # once (15µs+21µs) by Graph::BEGIN@86 at line 3
use strict;
# spent 36µs making 1 call to Graph::Attribute::BEGIN@3 # spent 21µs making 1 call to strict::import
4
5sub _F () { 0 }
6sub _COMPAT02 () { 0x00000001 }
7
8
# spent 115µs (92+22) within Graph::Attribute::import which was called: # once (92µs+22µs) by Graph::BEGIN@86 at line 86 of Graph.pm
sub import {
9612µs my $package = shift;
10 my %attr = @_;
11 my $caller = caller(0);
12521µs if (exists $attr{array}) {
13 my $i = $attr{array};
142162µs230µs
# spent 19µs (8+11) within Graph::Attribute::BEGIN@14 which was called: # once (8µs+11µs) by Graph::BEGIN@86 at line 14
no strict 'refs';
# spent 19µs making 1 call to Graph::Attribute::BEGIN@14 # spent 11µs making 1 call to strict::unimport
15220µs
# spent 8µs within Graph::Attribute::__ANON__[/Users/ap13/perl5/lib/perl5/Graph/Attribute.pm:15] which was called 2 times, avg 4µs/call: # 2 times (8µs+0s) by Graph::Attribute::get_attribute at line 86, avg 4µs/call
*{"${caller}::_get_attributes"} = sub { $_[0]->[ $i ] };
16 *{"${caller}::_set_attributes"} =
17624µs
# spent 19µs within Graph::Attribute::__ANON__[/Users/ap13/perl5/lib/perl5/Graph/Attribute.pm:19] which was called 2 times, avg 10µs/call: # 2 times (19µs+0s) by Graph::Attribute::set_attribute at line 59, avg 10µs/call
sub { $_[0]->[ $i ] ||= { };
18 $_[0]->[ $i ] = $_[1] if @_ == 2;
19 $_[0]->[ $i ] };
20 *{"${caller}::_has_attributes"} = sub { defined $_[0]->[ $i ] };
21 *{"${caller}::_delete_attributes"} = sub { undef $_[0]->[ $i ]; 1 };
22 } elsif (exists $attr{hash}) {
23 my $k = $attr{hash};
242232µs230µs
# spent 19µs (8+11) within Graph::Attribute::BEGIN@24 which was called: # once (8µs+11µs) by Graph::BEGIN@86 at line 24
no strict 'refs';
# spent 19µs making 1 call to Graph::Attribute::BEGIN@24 # spent 11µs making 1 call to strict::unimport
25 *{"${caller}::_get_attributes"} = sub { $_[0]->{ $k } };
26 *{"${caller}::_set_attributes"} =
27 sub { $_[0]->{ $k } ||= { };
28 $_[0]->{ $k } = $_[1] if @_ == 2;
29 $_[0]->{ $k } };
30 *{"${caller}::_has_attributes"} = sub { defined $_[0]->{ $k } };
31 *{"${caller}::_delete_attributes"} = sub { delete $_[0]->{ $k } };
32 } else {
33 die "Graph::Attribute::import($package @_) caller $caller\n";
34 }
35 my @api = qw(get_attribute
36 get_attributes
37 set_attribute
38 set_attributes
39 has_attribute
40 has_attributes
41 delete_attribute
42 delete_attributes
43 get_attribute_names
44 get_attribute_values);
452900ns if (exists $attr{map}) {
46 my $map = $attr{map};
47 for my $api (@api) {
482078µs1022µs my ($first, $rest) = ($api =~ /^(\w+?)_(.+)/);
# spent 22µs making 10 calls to Graph::Attribute::CORE:match, avg 2µs/call
492392µs229µs
# spent 18µs (8+11) within Graph::Attribute::BEGIN@49 which was called: # once (8µs+11µs) by Graph::BEGIN@86 at line 49
no strict 'refs';
# spent 18µs making 1 call to Graph::Attribute::BEGIN@49 # spent 10µs making 1 call to strict::unimport
50 *{"${caller}::${first}_${map}_${rest}"} = \&$api;
51 }
52 }
53}
54
55
# spent 63µs (44+19) within Graph::Attribute::set_attribute which was called 2 times, avg 32µs/call: # 2 times (44µs+19µs) by Graph::_check_cache at line 2657 of Graph.pm, avg 32µs/call
sub set_attribute {
561226µs my $g = shift;
57 my $v = pop;
58 my $a = pop;
59219µs my $p = $g->_set_attributes;
# spent 19µs making 2 calls to Graph::Attribute::__ANON__[Graph/Attribute.pm:19], avg 10µs/call
60 $p->{ $a } = $v;
61 return 1;
62}
63
64sub set_attributes {
65 my $g = shift;
66 my $a = pop;
67 my $p = $g->_set_attributes( $a );
68 return 1;
69}
70
71sub has_attribute {
72 my $g = shift;
73 my $a = pop;
74 my $p = $g->_get_attributes;
75 $p ? exists $p->{ $a } : 0;
76}
77
78sub has_attributes {
79 my $g = shift;
80 $g->_get_attributes ? 1 : 0;
81}
82
83
# spent 52µs (44+8) within Graph::Attribute::get_attribute which was called 2 times, avg 26µs/call: # 2 times (44µs+8µs) by Graph::_check_cache at line 2653 of Graph.pm, avg 26µs/call
sub get_attribute {
84832µs my $g = shift;
85 my $a = pop;
8628µs my $p = $g->_get_attributes;
# spent 8µs making 2 calls to Graph::Attribute::__ANON__[Graph/Attribute.pm:15], avg 4µs/call
87 $p ? $p->{ $a } : undef;
88}
89
90sub delete_attribute {
91 my $g = shift;
92 my $a = pop;
93 my $p = $g->_get_attributes;
94 if (defined $p) {
95 delete $p->{ $a };
96 return 1;
97 } else {
98 return 0;
99 }
100}
101
102sub delete_attributes {
103 my $g = shift;
104 if ($g->_has_attributes) {
105 $g->_delete_attributes;
106 return 1;
107 } else {
108 return 0;
109 }
110}
111
112sub get_attribute_names {
113 my $g = shift;
114 my $p = $g->_get_attributes;
115 defined $p ? keys %{ $p } : ( );
116}
117
118sub get_attribute_values {
119 my $g = shift;
120 my $p = $g->_get_attributes;
121 defined $p ? values %{ $p } : ( );
122}
123
124sub get_attributes {
125 my $g = shift;
126 my $a = $g->_get_attributes;
127 ($g->[ _F ] & _COMPAT02) ? (defined $a ? %{ $a } : ()) : $a;
128}
129
13012µs1;
 
# spent 22µs within Graph::Attribute::CORE:match which was called 10 times, avg 2µs/call: # 10 times (22µs+0s) by Graph::Attribute::import at line 48, avg 2µs/call
sub Graph::Attribute::CORE:match; # opcode