← 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:46:13 2015

Filename/Users/ap13/perl5/lib/perl5/Text/CSV.pm
StatementsExecuted 101 statements in 1.32ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1116.56ms7.52msText::CSV::::_load_ppText::CSV::_load_pp
111127µs127µsText::CSV::::_set_methodsText::CSV::_set_methods
11145µs221µsText::CSV::::newText::CSV::new
11143µs116µsText::CSV::::_load_xsText::CSV::_load_xs
11141µs62µsText::CSV::::AUTOLOADText::CSV::AUTOLOAD
11114µs14µsText::CSV::::CORE:substText::CSV::CORE:subst (opcode)
11114µs32µsText::CSV::::BEGIN@4Text::CSV::BEGIN@4
1119µs19µsText::CSV::::BEGIN@197Text::CSV::BEGIN@197
1118µs43µsText::CSV::::BEGIN@6Text::CSV::BEGIN@6
1118µs19µsText::CSV::::BEGIN@137Text::CSV::BEGIN@137
1116µs6µsText::CSV::::CORE:matchText::CSV::CORE:match (opcode)
1114µs4µsText::CSV::::BEGIN@8Text::CSV::BEGIN@8
1113µs3µsText::CSV::::importText::CSV::import
1113µs3µsText::CSV::::BEGIN@5Text::CSV::BEGIN@5
0000s0sText::CSV::::is_dynamicText::CSV::is_dynamic
0000s0sText::CSV::::is_ppText::CSV::is_pp
0000s0sText::CSV::::is_xsText::CSV::is_xs
0000s0sText::CSV::::moduleText::CSV::module
0000s0sText::CSV::::require_xs_versionText::CSV::require_xs_version
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Text::CSV;
2
3
4224µs250µs
# spent 32µs (14+18) within Text::CSV::BEGIN@4 which was called: # once (14µs+18µs) by Bio::Roary::GroupStatistics::BEGIN@21 at line 4
use strict;
# spent 32µs making 1 call to Text::CSV::BEGIN@4 # spent 18µs making 1 call to strict::import
5226µs13µs
# spent 3µs within Text::CSV::BEGIN@5 which was called: # once (3µs+0s) by Bio::Roary::GroupStatistics::BEGIN@21 at line 5
use Carp ();
# spent 3µs making 1 call to Text::CSV::BEGIN@5
6234µs279µs
# spent 43µs (8+36) within Text::CSV::BEGIN@6 which was called: # once (8µs+36µs) by Bio::Roary::GroupStatistics::BEGIN@21 at line 6
use vars qw( $VERSION $DEBUG );
# spent 43µs making 1 call to Text::CSV::BEGIN@6 # spent 36µs making 1 call to vars::import
7
8
# spent 4µs within Text::CSV::BEGIN@8 which was called: # once (4µs+0s) by Bio::Roary::GroupStatistics::BEGIN@21 at line 11
BEGIN {
91400ns $VERSION = '1.32';
1013µs $DEBUG = 0;
111464µs14µs}
# spent 4µs making 1 call to Text::CSV::BEGIN@8
12
13# if use CSV_XS, requires version
141600nsmy $Module_XS = 'Text::CSV_XS';
151100nsmy $Module_PP = 'Text::CSV_PP';
161200nsmy $XS_Version = '0.99';
17
181100nsmy $Is_Dynamic = 0;
19
20# used in _load_xs and _load_pp
2110smy $Install_Dont_Die = 1; # When _load_xs fails to load XS, don't die.
2210smy $Install_Only = 2; # Don't call _set_methods()
23
24
2517µsmy @PublicMethods = qw/
26 version types quote_char escape_char sep_char eol always_quote binary allow_whitespace
27 keep_meta_info allow_loose_quotes allow_loose_escapes verbatim meta_info is_quoted is_binary eof
28 getline print parse combine fields string error_diag error_input status blank_is_undef empty_is_undef
29 getline_hr column_names bind_columns auto_diag quote_space quote_null getline_all getline_hr_all
30 is_missing quote_binary record_number print_hr
31 PV IV NV
32/;
33#
341700nsmy @UndocumentedXSMethods = qw/Combine Parse SetDiag/;
35
361100nsmy @UndocumentedPPMethods = qw//; # Currently empty
37
38
39# Check the environment variable to decide worker module.
40
411500nsunless ($Text::CSV::Worker) {
421100ns $Text::CSV::DEBUG and Carp::carp("Check used worker module...");
43
4411µs if ( exists $ENV{PERL_TEXT_CSV} ) {
45 if ($ENV{PERL_TEXT_CSV} eq '0' or $ENV{PERL_TEXT_CSV} eq 'Text::CSV_PP') {
46 _load_pp();
47 }
48 elsif ($ENV{PERL_TEXT_CSV} eq '1' or $ENV{PERL_TEXT_CSV} =~ /Text::CSV_XS\s*,\s*Text::CSV_PP/) {
49 _load_xs($Install_Dont_Die) or _load_pp();
50 }
51 elsif ($ENV{PERL_TEXT_CSV} eq '2' or $ENV{PERL_TEXT_CSV} eq 'Text::CSV_XS') {
52 _load_xs();
53 }
54 else {
55 Carp::croak "The value of environmental variable 'PERL_TEXT_CSV' is invalid.";
56 }
57 }
58 else {
5913µs27.64ms _load_xs($Install_Dont_Die) or _load_pp();
# spent 7.52ms making 1 call to Text::CSV::_load_pp # spent 116µs making 1 call to Text::CSV::_load_xs
60 }
61
62}
63
- -
66
# spent 3µs within Text::CSV::import which was called: # once (3µs+0s) by Bio::Roary::GroupStatistics::BEGIN@21 at line 21 of lib/Bio/Roary/GroupStatistics.pm
sub import {
6716µs my ($class, $option) = @_;
68}
69
- -
72
# spent 221µs (45+176) within Text::CSV::new which was called: # once (45µs+176µs) by Bio::Roary::GroupStatistics::_build__text_csv_obj at line 49 of lib/Bio/Roary/GroupStatistics.pm
sub new { # normal mode
731900ns my $proto = shift;
741600ns my $class = ref($proto) || $proto;
75
761200ns unless ( $proto ) { # for Text::CSV_XS/PP::new(0);
77 return eval qq| $Text::CSV::Worker\::new( \$proto ) |;
78 }
79
80 #if (ref $_[0] and $_[0]->{module}) {
81 # Carp::croak("Can't set 'module' in non dynamic mode.");
82 #}
83
84125µs1176µs if ( my $obj = $Text::CSV::Worker->new(@_) ) {
# spent 176µs making 1 call to Text::CSV_PP::new
8514µs $obj->{_MODULE} = $Text::CSV::Worker;
86112µs bless $obj, $class;
8718µs return $obj;
88 }
89 else {
90 return;
91 }
92
93
94}
95
96
97sub require_xs_version { $XS_Version; }
98
99
100sub module {
101 my $proto = shift;
102 return !ref($proto) ? $Text::CSV::Worker
103 : ref($proto->{_MODULE}) ? ref($proto->{_MODULE}) : $proto->{_MODULE};
104}
105
10612µs*backend = *module;
107
108
109sub is_xs {
110 return $_[0]->module eq $Module_XS;
111}
112
113
114sub is_pp {
115 return $_[0]->module eq $Module_PP;
116}
117
118
119sub is_dynamic { $Is_Dynamic; }
120
121
122
# spent 62µs (41+21) within Text::CSV::AUTOLOAD which was called: # once (41µs+21µs) by Bio::Roary::CommandLine::RoaryPostAnalysis::run at line 19 of bin/pan_genome_post_analysis
sub AUTOLOAD {
12312µs my $self = $_[0];
1241800ns my $attr = $Text::CSV::AUTOLOAD;
125131µs114µs $attr =~ s/.*:://;
# spent 14µs making 1 call to Text::CSV::CORE:subst
126
127126µs16µs return if $attr =~ /^[A-Z]+$/;
# spent 6µs making 1 call to Text::CSV::CORE:match
128 Carp::croak( "Can't locate method $attr" ) unless $attr =~ /^_/;
129
130 my $pkg = $Text::CSV::Worker;
131
132 my $method = "$pkg\::$attr";
133
134 $Text::CSV::DEBUG and Carp::carp("'$attr' is private method, so try to autoload...");
135
136 local $^W;
1372249µs231µs
# spent 19µs (8+12) within Text::CSV::BEGIN@137 which was called: # once (8µs+12µs) by Bio::Roary::GroupStatistics::BEGIN@21 at line 137
no strict qw(refs);
# spent 19µs making 1 call to Text::CSV::BEGIN@137 # spent 12µs making 1 call to strict::unimport
138
139 *{"Text::CSV::$attr"} = *{"$pkg\::$attr"};
140
141 goto &$attr;
142}
143
- -
146
# spent 116µs (43+74) within Text::CSV::_load_xs which was called: # once (43µs+74µs) by Bio::Roary::GroupStatistics::BEGIN@21 at line 59
sub _load_xs {
1471200ns my $opt = shift;
148
1491100ns $Text::CSV::DEBUG and Carp::carp "Load $Module_XS.";
150
151128µs eval qq| use $Module_XS $XS_Version |;
# spent 84µs executing statements in string eval
# includes 74µs spent executing 1 call to 1 sub defined therein.
152
1531200ns if ($@) {
1541500ns if (defined $opt and $opt & $Install_Dont_Die) {
15510s $Text::CSV::DEBUG and Carp::carp "Can't load $Module_XS...($@)";
15614µs return 0;
157 }
158 Carp::croak $@;
159 }
160
161 push @Text::CSV::ISA, 'Text::CSV_XS';
162
163 unless (defined $opt and $opt & $Install_Only) {
164 _set_methods( $Text::CSV::Worker = $Module_XS );
165 }
166
167 return 1;
168};
169
170
171
# spent 7.52ms (6.56+965µs) within Text::CSV::_load_pp which was called: # once (6.56ms+965µs) by Bio::Roary::GroupStatistics::BEGIN@21 at line 59
sub _load_pp {
1721300ns my $opt = shift;
173
1741100ns $Text::CSV::DEBUG and Carp::carp "Load $Module_PP.";
175
176116µs eval qq| require $Module_PP |;
# spent 73µs executing statements in string eval
1771300ns if ($@) {
178 Carp::croak $@;
179 }
180
18118µs push @Text::CSV::ISA, 'Text::CSV_PP';
182
18315µs unless (defined $opt and $opt & $Install_Only) {
18414µs1127µs _set_methods( $Text::CSV::Worker = $Module_PP );
# spent 127µs making 1 call to Text::CSV::_set_methods
185 }
186};
187
- -
191
# spent 127µs within Text::CSV::_set_methods which was called: # once (127µs+0s) by Text::CSV::_load_pp at line 184
sub _set_methods {
1921600ns my $class = shift;
193
194 #return;
195
19612µs local $^W;
1972137µs229µs
# spent 19µs (9+10) within Text::CSV::BEGIN@197 which was called: # once (9µs+10µs) by Bio::Roary::GroupStatistics::BEGIN@21 at line 197
no strict qw(refs);
# spent 19µs making 1 call to Text::CSV::BEGIN@197 # spent 10µs making 1 call to strict::unimport
198
19912µs for my $method (@PublicMethods) {
20043106µs *{"Text::CSV::$method"} = \&{"$class\::$method"};
201 }
202
2031600ns if ($Text::CSV::Worker eq $Module_XS) {
204 for my $method (@UndocumentedXSMethods) {
205 *{"Text::CSV::$method"} = \&{"$Module_XS\::$method"};
206 }
207 }
208
20919µs if ($Text::CSV::Worker eq $Module_PP) {
210 for my $method (@UndocumentedPPMethods) {
211 *{"Text::CSV::$method"} = \&{"$Module_PP\::$method"};
212 }
213 }
214
215}
216
- -
219162µs1;
220__END__
 
# spent 6µs within Text::CSV::CORE:match which was called: # once (6µs+0s) by Text::CSV::AUTOLOAD at line 127
sub Text::CSV::CORE:match; # opcode
# spent 14µs within Text::CSV::CORE:subst which was called: # once (14µs+0s) by Text::CSV::AUTOLOAD at line 125
sub Text::CSV::CORE:subst; # opcode