| 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 | Text::CSV::_load_pp |
| 1 | 1 | 1 | 127µs | 127µs | Text::CSV::_set_methods |
| 1 | 1 | 1 | 45µs | 221µs | Text::CSV::new |
| 1 | 1 | 1 | 43µs | 116µs | Text::CSV::_load_xs |
| 1 | 1 | 1 | 41µs | 62µs | Text::CSV::AUTOLOAD |
| 1 | 1 | 1 | 14µs | 14µs | Text::CSV::CORE:subst (opcode) |
| 1 | 1 | 1 | 14µs | 32µs | Text::CSV::BEGIN@4 |
| 1 | 1 | 1 | 9µs | 19µs | Text::CSV::BEGIN@197 |
| 1 | 1 | 1 | 8µs | 43µs | Text::CSV::BEGIN@6 |
| 1 | 1 | 1 | 8µs | 19µs | Text::CSV::BEGIN@137 |
| 1 | 1 | 1 | 6µs | 6µs | Text::CSV::CORE:match (opcode) |
| 1 | 1 | 1 | 4µs | 4µs | Text::CSV::BEGIN@8 |
| 1 | 1 | 1 | 3µs | 3µs | Text::CSV::import |
| 1 | 1 | 1 | 3µs | 3µs | Text::CSV::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | Text::CSV::is_dynamic |
| 0 | 0 | 0 | 0s | 0s | Text::CSV::is_pp |
| 0 | 0 | 0 | 0s | 0s | Text::CSV::is_xs |
| 0 | 0 | 0 | 0s | 0s | Text::CSV::module |
| 0 | 0 | 0 | 0s | 0s | Text::CSV::require_xs_version |
| 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 | 1 | 400ns | $VERSION = '1.32'; | ||
| 10 | 1 | 3µs | $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 | 1 | 500ns | unless ($Text::CSV::Worker) { | ||
| 42 | 1 | 100ns | $Text::CSV::DEBUG and Carp::carp("Check used worker module..."); | ||
| 43 | |||||
| 44 | 1 | 1µ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 | 1 | 3µs | 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 | 1 | 900ns | my $proto = shift; | ||
| 74 | 1 | 600ns | my $class = ref($proto) || $proto; | ||
| 75 | |||||
| 76 | 1 | 200ns | 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 | 1 | 25µs | 1 | 176µs | if ( my $obj = $Text::CSV::Worker->new(@_) ) { # spent 176µs making 1 call to Text::CSV_PP::new |
| 85 | 1 | 4µs | $obj->{_MODULE} = $Text::CSV::Worker; | ||
| 86 | 1 | 12µs | bless $obj, $class; | ||
| 87 | 1 | 8µs | 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 | 1 | 2µs | my $self = $_[0]; | ||
| 124 | 1 | 800ns | my $attr = $Text::CSV::AUTOLOAD; | ||
| 125 | 1 | 31µs | 1 | 14µs | $attr =~ s/.*:://; # spent 14µs making 1 call to Text::CSV::CORE:subst |
| 126 | |||||
| 127 | 1 | 26µs | 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 | 1 | 200ns | my $opt = shift; | ||
| 148 | |||||
| 149 | 1 | 100ns | $Text::CSV::DEBUG and Carp::carp "Load $Module_XS."; | ||
| 150 | |||||
| 151 | 1 | 28µ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 | |||||
| 153 | 1 | 200ns | if ($@) { | ||
| 154 | 1 | 500ns | if (defined $opt and $opt & $Install_Dont_Die) { | ||
| 155 | 1 | 0s | $Text::CSV::DEBUG and Carp::carp "Can't load $Module_XS...($@)"; | ||
| 156 | 1 | 4µ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 | ||||
| 172 | 1 | 300ns | my $opt = shift; | ||
| 173 | |||||
| 174 | 1 | 100ns | $Text::CSV::DEBUG and Carp::carp "Load $Module_PP."; | ||
| 175 | |||||
| 176 | 1 | 16µs | eval qq| require $Module_PP |; # spent 73µs executing statements in string eval | ||
| 177 | 1 | 300ns | if ($@) { | ||
| 178 | Carp::croak $@; | ||||
| 179 | } | ||||
| 180 | |||||
| 181 | 1 | 8µs | push @Text::CSV::ISA, 'Text::CSV_PP'; | ||
| 182 | |||||
| 183 | 1 | 5µs | unless (defined $opt and $opt & $Install_Only) { | ||
| 184 | 1 | 4µs | 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 | 1 | 600ns | my $class = shift; | ||
| 193 | |||||
| 194 | #return; | ||||
| 195 | |||||
| 196 | 1 | 2µs | 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 | 1 | 2µs | for my $method (@PublicMethods) { | ||
| 200 | 43 | 106µs | *{"Text::CSV::$method"} = \&{"$class\::$method"}; | ||
| 201 | } | ||||
| 202 | |||||
| 203 | 1 | 600ns | if ($Text::CSV::Worker eq $Module_XS) { | ||
| 204 | for my $method (@UndocumentedXSMethods) { | ||||
| 205 | *{"Text::CSV::$method"} = \&{"$Module_XS\::$method"}; | ||||
| 206 | } | ||||
| 207 | } | ||||
| 208 | |||||
| 209 | 1 | 9µ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 | |||||
| - - | |||||
| 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 |