Filename | /Users/ap13/perl5/lib/perl5/Text/CSV.pm |
Statements | Executed 101 statements in 1.32ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 6.56ms | 7.52ms | _load_pp | Text::CSV::
1 | 1 | 1 | 127µs | 127µs | _set_methods | Text::CSV::
1 | 1 | 1 | 45µs | 221µs | new | Text::CSV::
1 | 1 | 1 | 43µs | 116µs | _load_xs | Text::CSV::
1 | 1 | 1 | 41µs | 62µs | AUTOLOAD | Text::CSV::
1 | 1 | 1 | 14µs | 14µs | CORE:subst (opcode) | Text::CSV::
1 | 1 | 1 | 14µs | 32µs | BEGIN@4 | Text::CSV::
1 | 1 | 1 | 9µs | 19µs | BEGIN@197 | Text::CSV::
1 | 1 | 1 | 8µs | 43µs | BEGIN@6 | Text::CSV::
1 | 1 | 1 | 8µs | 19µs | BEGIN@137 | Text::CSV::
1 | 1 | 1 | 6µs | 6µs | CORE:match (opcode) | Text::CSV::
1 | 1 | 1 | 4µs | 4µs | BEGIN@8 | Text::CSV::
1 | 1 | 1 | 3µs | 3µs | import | Text::CSV::
1 | 1 | 1 | 3µs | 3µs | BEGIN@5 | Text::CSV::
0 | 0 | 0 | 0s | 0s | is_dynamic | Text::CSV::
0 | 0 | 0 | 0s | 0s | is_pp | Text::CSV::
0 | 0 | 0 | 0s | 0s | is_xs | Text::CSV::
0 | 0 | 0 | 0s | 0s | module | Text::CSV::
0 | 0 | 0 | 0s | 0s | require_xs_version | Text::CSV::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Text::CSV; | ||||
2 | |||||
3 | |||||
4 | 2 | 24µs | 2 | 50µ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 # spent 32µs making 1 call to Text::CSV::BEGIN@4
# spent 18µs making 1 call to strict::import |
5 | 2 | 26µs | 1 | 3µ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 # spent 3µs making 1 call to Text::CSV::BEGIN@5 |
6 | 2 | 34µs | 2 | 79µ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 # 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 | ||||
9 | 2 | 4µs | $VERSION = '1.32'; | ||
10 | $DEBUG = 0; | ||||
11 | 1 | 464µs | 1 | 4µs | } # spent 4µs making 1 call to Text::CSV::BEGIN@8 |
12 | |||||
13 | # if use CSV_XS, requires version | ||||
14 | 1 | 600ns | my $Module_XS = 'Text::CSV_XS'; | ||
15 | 1 | 100ns | my $Module_PP = 'Text::CSV_PP'; | ||
16 | 1 | 200ns | my $XS_Version = '0.99'; | ||
17 | |||||
18 | 1 | 100ns | my $Is_Dynamic = 0; | ||
19 | |||||
20 | # used in _load_xs and _load_pp | ||||
21 | 1 | 0s | my $Install_Dont_Die = 1; # When _load_xs fails to load XS, don't die. | ||
22 | 1 | 0s | my $Install_Only = 2; # Don't call _set_methods() | ||
23 | |||||
24 | |||||
25 | 1 | 7µs | my @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 | # | ||||
34 | 1 | 700ns | my @UndocumentedXSMethods = qw/Combine Parse SetDiag/; | ||
35 | |||||
36 | 1 | 100ns | my @UndocumentedPPMethods = qw//; # Currently empty | ||
37 | |||||
38 | |||||
39 | # Check the environment variable to decide worker module. | ||||
40 | |||||
41 | 3 | 2µs | unless ($Text::CSV::Worker) { | ||
42 | $Text::CSV::DEBUG and Carp::carp("Check used worker module..."); | ||||
43 | |||||
44 | 1 | 3µ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 { | ||||
59 | 2 | 7.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 | ||||
67 | 1 | 6µ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 | ||||
73 | 4 | 27µs | my $proto = shift; | ||
74 | my $class = ref($proto) || $proto; | ||||
75 | |||||
76 | 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 | |||||
84 | 3 | 24µs | 1 | 176µs | if ( my $obj = $Text::CSV::Worker->new(@_) ) { # spent 176µs making 1 call to Text::CSV_PP::new |
85 | $obj->{_MODULE} = $Text::CSV::Worker; | ||||
86 | bless $obj, $class; | ||||
87 | return $obj; | ||||
88 | } | ||||
89 | else { | ||||
90 | return; | ||||
91 | } | ||||
92 | |||||
93 | |||||
94 | } | ||||
95 | |||||
96 | |||||
97 | sub require_xs_version { $XS_Version; } | ||||
98 | |||||
99 | |||||
100 | sub module { | ||||
101 | my $proto = shift; | ||||
102 | return !ref($proto) ? $Text::CSV::Worker | ||||
103 | : ref($proto->{_MODULE}) ? ref($proto->{_MODULE}) : $proto->{_MODULE}; | ||||
104 | } | ||||
105 | |||||
106 | 1 | 2µs | *backend = *module; | ||
107 | |||||
108 | |||||
109 | sub is_xs { | ||||
110 | return $_[0]->module eq $Module_XS; | ||||
111 | } | ||||
112 | |||||
113 | |||||
114 | sub is_pp { | ||||
115 | return $_[0]->module eq $Module_PP; | ||||
116 | } | ||||
117 | |||||
118 | |||||
119 | sub 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 | ||||
123 | 4 | 60µs | my $self = $_[0]; | ||
124 | my $attr = $Text::CSV::AUTOLOAD; | ||||
125 | 1 | 14µs | $attr =~ s/.*:://; # spent 14µs making 1 call to Text::CSV::CORE:subst | ||
126 | |||||
127 | 1 | 6µ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; | ||||
137 | 2 | 249µs | 2 | 31µ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 # 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 | ||||
147 | 4 | 29µs | my $opt = shift; | ||
148 | |||||
149 | $Text::CSV::DEBUG and Carp::carp "Load $Module_XS."; | ||||
150 | |||||
151 | 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 | |||||
153 | 1 | 500ns | if ($@) { | ||
154 | 2 | 4µs | if (defined $opt and $opt & $Install_Dont_Die) { | ||
155 | $Text::CSV::DEBUG and Carp::carp "Can't load $Module_XS...($@)"; | ||||
156 | 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 | ||||
172 | 6 | 30µs | my $opt = shift; | ||
173 | |||||
174 | $Text::CSV::DEBUG and Carp::carp "Load $Module_PP."; | ||||
175 | |||||
176 | eval qq| require $Module_PP |; # spent 73µs executing statements in string eval | ||||
177 | if ($@) { | ||||
178 | Carp::croak $@; | ||||
179 | } | ||||
180 | |||||
181 | push @Text::CSV::ISA, 'Text::CSV_PP'; | ||||
182 | |||||
183 | 1 | 4µs | unless (defined $opt and $opt & $Install_Only) { | ||
184 | 1 | 127µ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 | ||||
192 | 5 | 14µs | my $class = shift; | ||
193 | |||||
194 | #return; | ||||
195 | |||||
196 | local $^W; | ||||
197 | 2 | 137µs | 2 | 29µ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 # spent 19µs making 1 call to Text::CSV::BEGIN@197
# spent 10µs making 1 call to strict::unimport |
198 | |||||
199 | for my $method (@PublicMethods) { | ||||
200 | 43 | 106µs | *{"Text::CSV::$method"} = \&{"$class\::$method"}; | ||
201 | } | ||||
202 | |||||
203 | if ($Text::CSV::Worker eq $Module_XS) { | ||||
204 | for my $method (@UndocumentedXSMethods) { | ||||
205 | *{"Text::CSV::$method"} = \&{"$Module_XS\::$method"}; | ||||
206 | } | ||||
207 | } | ||||
208 | |||||
209 | if ($Text::CSV::Worker eq $Module_PP) { | ||||
210 | for my $method (@UndocumentedPPMethods) { | ||||
211 | *{"Text::CSV::$method"} = \&{"$Module_PP\::$method"}; | ||||
212 | } | ||||
213 | } | ||||
214 | |||||
215 | } | ||||
216 | |||||
- - | |||||
219 | 1 | 62µs | 1; | ||
220 | __END__ | ||||
# spent 6µs within Text::CSV::CORE:match which was called:
# once (6µs+0s) by Text::CSV::AUTOLOAD at line 127 | |||||
# spent 14µs within Text::CSV::CORE:subst which was called:
# once (14µs+0s) by Text::CSV::AUTOLOAD at line 125 |