| Filename | /home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Archive/Zip/FileMember.pm |
| Statements | Executed 383 statements in 495µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 75 | 11 | 1 | 118µs | 554µs | Archive::Zip::FileMember::fh |
| 31 | 4 | 2 | 85µs | 158µs | Archive::Zip::FileMember::endRead |
| 7 | 1 | 1 | 37µs | 409µs | Archive::Zip::FileMember::_openFile |
| 1 | 1 | 1 | 10µs | 12µs | Archive::Zip::FileMember::BEGIN@3 |
| 14 | 2 | 2 | 8µs | 8µs | Archive::Zip::FileMember::externalFileName |
| 1 | 1 | 1 | 6µs | 6µs | Archive::Zip::FileMember::BEGIN@6 |
| 1 | 1 | 1 | 4µs | 22µs | Archive::Zip::FileMember::BEGIN@4 |
| 1 | 1 | 1 | 4µs | 69µs | Archive::Zip::FileMember::BEGIN@11 |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::FileMember::_become |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::FileMember::_usesFileNamed |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Archive::Zip::FileMember; | ||||
| 2 | |||||
| 3 | 2 | 24µs | 2 | 14µs | # spent 12µs (10+2) within Archive::Zip::FileMember::BEGIN@3 which was called:
# once (10µs+2µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 3 # spent 12µs making 1 call to Archive::Zip::FileMember::BEGIN@3
# spent 2µs making 1 call to strict::import |
| 4 | 2 | 35µs | 2 | 40µs | # spent 22µs (4+18) within Archive::Zip::FileMember::BEGIN@4 which was called:
# once (4µs+18µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 4 # spent 22µs making 1 call to Archive::Zip::FileMember::BEGIN@4
# spent 18µs making 1 call to vars::import |
| 5 | |||||
| 6 | # spent 6µs within Archive::Zip::FileMember::BEGIN@6 which was called:
# once (6µs+0s) by Spreadsheet::ParseXLSX::BEGIN@11 at line 9 | ||||
| 7 | 1 | 200ns | $VERSION = '1.68'; | ||
| 8 | 1 | 6µs | @ISA = qw ( Archive::Zip::Member ); | ||
| 9 | 1 | 14µs | 1 | 6µs | } # spent 6µs making 1 call to Archive::Zip::FileMember::BEGIN@6 |
| 10 | |||||
| 11 | 1 | 2µs | 1 | 66µs | # spent 69µs (4+66) within Archive::Zip::FileMember::BEGIN@11 which was called:
# once (4µs+66µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 13 # spent 66µs making 1 call to Exporter::import |
| 12 | :UTILITY_METHODS | ||||
| 13 | 1 | 158µs | 1 | 69µs | ); # spent 69µs making 1 call to Archive::Zip::FileMember::BEGIN@11 |
| 14 | |||||
| 15 | # spent 8µs within Archive::Zip::FileMember::externalFileName which was called 14 times, avg 557ns/call:
# 7 times (5µs+0s) by Archive::Zip::FileMember::_openFile at line 38, avg 686ns/call
# 7 times (3µs+0s) by Archive::Zip::ZipFileMember::_seekToLocalHeader at line 70 of Archive/Zip/ZipFileMember.pm, avg 429ns/call | ||||
| 16 | 14 | 15µs | shift->{'externalFileName'}; | ||
| 17 | } | ||||
| 18 | |||||
| 19 | # Return true if I depend on the named file | ||||
| 20 | sub _usesFileNamed { | ||||
| 21 | my $self = shift; | ||||
| 22 | my $fileName = shift; | ||||
| 23 | my $xfn = $self->externalFileName(); | ||||
| 24 | return undef if ref($xfn); | ||||
| 25 | return $xfn eq $fileName; | ||||
| 26 | } | ||||
| 27 | |||||
| 28 | # spent 554µs (118+437) within Archive::Zip::FileMember::fh which was called 75 times, avg 7µs/call:
# 10 times (18µs+5µs) by Archive::Zip::ZipFileMember::_readCentralDirectoryFileHeader at line 369 of Archive/Zip/ZipFileMember.pm, avg 2µs/call
# 7 times (16µs+409µs) by Archive::Zip::ZipFileMember::rewindData at line 443 of Archive/Zip/ZipFileMember.pm, avg 61µs/call
# 7 times (19µs+2µs) by Archive::Zip::ZipFileMember::rewindData at line 458 of Archive/Zip/ZipFileMember.pm, avg 3µs/call
# 7 times (12µs+6µs) by Archive::Zip::ZipFileMember::rewindData at line 445 of Archive/Zip/ZipFileMember.pm, avg 2µs/call
# 7 times (10µs+3µs) by Archive::Zip::ZipFileMember::_skipLocalFileHeader at line 138 of Archive/Zip/ZipFileMember.pm, avg 2µs/call
# 7 times (8µs+3µs) by Archive::Zip::ZipFileMember::_readRawChunk at line 470 of Archive/Zip/ZipFileMember.pm, avg 2µs/call
# 7 times (8µs+2µs) by Archive::Zip::ZipFileMember::_skipLocalFileHeader at line 157 of Archive/Zip/ZipFileMember.pm, avg 2µs/call
# 7 times (8µs+2µs) by Archive::Zip::ZipFileMember::_seekToLocalHeader at line 67 of Archive/Zip/ZipFileMember.pm, avg 2µs/call
# 7 times (8µs+2µs) by Archive::Zip::ZipFileMember::_seekToLocalHeader at line 70 of Archive/Zip/ZipFileMember.pm, avg 1µs/call
# 7 times (8µs+2µs) by Archive::Zip::ZipFileMember::_skipLocalFileHeader at line 178 of Archive/Zip/ZipFileMember.pm, avg 1µs/call
# 2 times (2µs+500ns) by Archive::Zip::ZipFileMember::_skipLocalFileHeader at line 165 of Archive/Zip/ZipFileMember.pm, avg 1µs/call | ||||
| 29 | 75 | 6µs | my $self = shift; | ||
| 30 | $self->_openFile() | ||||
| 31 | 75 | 54µs | 75 | 437µs | if !defined($self->{'fh'}) || !$self->{'fh'}->opened(); # spent 409µs making 7 calls to Archive::Zip::FileMember::_openFile, avg 58µs/call
# spent 28µs making 68 calls to IO::Handle::opened, avg 412ns/call |
| 32 | 75 | 65µs | return $self->{'fh'}; | ||
| 33 | } | ||||
| 34 | |||||
| 35 | # opens my file handle from my file name | ||||
| 36 | # spent 409µs (37+372) within Archive::Zip::FileMember::_openFile which was called 7 times, avg 58µs/call:
# 7 times (37µs+372µs) by Archive::Zip::FileMember::fh at line 31, avg 58µs/call | ||||
| 37 | 7 | 900ns | my $self = shift; | ||
| 38 | 7 | 12µs | 14 | 310µs | my ($status, $fh) = _newFileHandle($self->externalFileName(), 'r'); # spent 306µs making 7 calls to Archive::Zip::_newFileHandle, avg 44µs/call
# spent 5µs making 7 calls to Archive::Zip::FileMember::externalFileName, avg 686ns/call |
| 39 | 7 | 1µs | if (!$status) { | ||
| 40 | _ioError("Can't open", $self->externalFileName()); | ||||
| 41 | return undef; | ||||
| 42 | } | ||||
| 43 | 7 | 2µs | $self->{'fh'} = $fh; | ||
| 44 | 7 | 6µs | 7 | 62µs | _binmode($fh); # spent 62µs making 7 calls to Archive::Zip::_binmode, avg 9µs/call |
| 45 | 7 | 8µs | return $fh; | ||
| 46 | } | ||||
| 47 | |||||
| 48 | # Make sure I close my file handle | ||||
| 49 | # spent 158µs (85+72) within Archive::Zip::FileMember::endRead which was called 31 times, avg 5µs/call:
# 10 times (17µs+12µs) by Archive::Zip::Archive::readFromFileHandle at line 794 of Archive/Zip/Archive.pm, avg 3µs/call
# 7 times (51µs+51µs) by Archive::Zip::Member::_inflateChunk at line 1185 of Archive/Zip/Member.pm, avg 15µs/call
# 7 times (9µs+5µs) by Archive::Zip::Member::readChunk at line 1132 of Archive/Zip/Member.pm, avg 2µs/call
# 7 times (9µs+5µs) by Archive::Zip::Member::contents at line 1308 of Archive/Zip/Member.pm, avg 2µs/call | ||||
| 50 | 31 | 3µs | my $self = shift; | ||
| 51 | 31 | 42µs | undef $self->{'fh'}; # _closeFile(); | ||
| 52 | 31 | 40µs | 31 | 72µs | return $self->SUPER::endRead(@_); # spent 72µs making 31 calls to Archive::Zip::Member::endRead, avg 2µs/call |
| 53 | } | ||||
| 54 | |||||
| 55 | sub _become { | ||||
| 56 | my $self = shift; | ||||
| 57 | my $newClass = shift; | ||||
| 58 | return $self if ref($self) eq $newClass; | ||||
| 59 | delete($self->{'externalFileName'}); | ||||
| 60 | delete($self->{'fh'}); | ||||
| 61 | return $self->SUPER::_become($newClass); | ||||
| 62 | } | ||||
| 63 | |||||
| 64 | 1 | 2µs | 1; |