← Index
NYTProf Performance Profile   « block view • line view • sub view »
For C:/lo/libo-master/solenv/bin/make_installer.pl
  Run on Mon Sep 24 00:52:54 2012
Reported on Mon Sep 24 07:34:49 2012

Filename/usr/lib/perl5/site_perl/5.14/Archive/Zip/ZipFileMember.pm
StatementsExecuted 739597 statements in 1.72s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
860111404ms10.3sArchive::Zip::ZipFileMember::::rewindDataArchive::Zip::ZipFileMember::rewindData
998211371ms718msArchive::Zip::ZipFileMember::::_readCentralDirectoryFileHeaderArchive::Zip::ZipFileMember::_readCentralDirectoryFileHeader
998221325ms1.10sArchive::Zip::ZipFileMember::::_seekToLocalHeaderArchive::Zip::ZipFileMember::_seekToLocalHeader
860111300ms827msArchive::Zip::ZipFileMember::::_skipLocalFileHeaderArchive::Zip::ZipFileMember::_skipLocalFileHeader
2017421145ms226msArchive::Zip::ZipFileMember::::isDirectoryArchive::Zip::ZipFileMember::isDirectory
1034911127ms511msArchive::Zip::ZipFileMember::::_readRawChunkArchive::Zip::ZipFileMember::_readRawChunk
1019211112ms850msArchive::Zip::ZipFileMember::::_newFromZipFileArchive::Zip::ZipFileMember::_newFromZipFile
13811168.7ms1.09sArchive::Zip::ZipFileMember::::_becomeArchive::Zip::ZipFileMember::_become
13811164.7ms162msArchive::Zip::ZipFileMember::::_readLocalFileHeaderArchive::Zip::ZipFileMember::_readLocalFileHeader
199643145.0ms45.0msArchive::Zip::ZipFileMember::::CORE:unpackArchive::Zip::ZipFileMember::CORE:unpack (opcode)
99821123.2ms23.2msArchive::Zip::ZipFileMember::::localHeaderRelativeOffsetArchive::Zip::ZipFileMember::localHeaderRelativeOffset
86011119.8ms19.8msArchive::Zip::ZipFileMember::::dataOffsetArchive::Zip::ZipFileMember::dataOffset
111298µs313µsArchive::Zip::ZipFileMember::::BEGIN@3Archive::Zip::ZipFileMember::BEGIN@3
11133µs33µsArchive::Zip::ZipFileMember::::BEGIN@6Archive::Zip::ZipFileMember::BEGIN@6
11119µs870µsArchive::Zip::ZipFileMember::::BEGIN@11Archive::Zip::ZipFileMember::BEGIN@11
11116µs116µsArchive::Zip::ZipFileMember::::BEGIN@4Archive::Zip::ZipFileMember::BEGIN@4
0000s0sArchive::Zip::ZipFileMember::::_readDataDescriptorArchive::Zip::ZipFileMember::_readDataDescriptor
0000s0sArchive::Zip::ZipFileMember::::diskNumberStartArchive::Zip::ZipFileMember::diskNumberStart
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Archive::Zip::ZipFileMember;
2
3282µs2328µs
# spent 313µs (298+15) within Archive::Zip::ZipFileMember::BEGIN@3 which was called: # once (298µs+15µs) by installer::archivefiles::BEGIN@30 at line 3
use strict;
# spent 313µs making 1 call to Archive::Zip::ZipFileMember::BEGIN@3 # spent 15µs making 1 call to strict::import
4298µs2216µs
# spent 116µs (16+100) within Archive::Zip::ZipFileMember::BEGIN@4 which was called: # once (16µs+100µs) by installer::archivefiles::BEGIN@30 at line 4
use vars qw( $VERSION @ISA );
# spent 116µs making 1 call to Archive::Zip::ZipFileMember::BEGIN@4 # spent 100µs making 1 call to vars::import
5
6
# spent 33µs within Archive::Zip::ZipFileMember::BEGIN@6 which was called: # once (33µs+0s) by installer::archivefiles::BEGIN@30 at line 9
BEGIN {
711µs $VERSION = '1.30';
8132µs @ISA = qw ( Archive::Zip::FileMember );
91115µs133µs}
# spent 33µs making 1 call to Archive::Zip::ZipFileMember::BEGIN@6
10
11114µs1851µs
# spent 870µs (19+851) within Archive::Zip::ZipFileMember::BEGIN@11 which was called: # once (19µs+851µs) by installer::archivefiles::BEGIN@30 at line 16
use Archive::Zip qw(
# spent 851µs making 1 call to Exporter::import
12 :CONSTANTS
13 :ERROR_CODES
14 :PKZIP_CONSTANTS
15 :UTILITY_METHODS
1613.52ms1870µs);
# spent 870µs making 1 call to Archive::Zip::ZipFileMember::BEGIN@11
17
18# Create a new Archive::Zip::ZipFileMember
19# given a filename and optional open file handle
20#
21
# spent 850ms (112+738) within Archive::Zip::ZipFileMember::_newFromZipFile which was called 10192 times, avg 83µs/call: # 10192 times (112ms+738ms) by Archive::Zip::Member::_newFromZipFile at line 42 of Archive/Zip/Member.pm, avg 83µs/call
sub _newFromZipFile {
22101925.32ms my $class = shift;
23101924.54ms my $fh = shift;
24101925.22ms my $externalFileName = shift;
25101924.70ms my $possibleEocdOffset = shift; # normally 0
26
271019231.4ms10192738ms my $self = $class->new(
# spent 738ms making 10192 calls to Archive::Zip::Member::new, avg 72µs/call
28 'crc32' => 0,
29 'diskNumberStart' => 0,
30 'localHeaderRelativeOffset' => 0,
31 'dataOffset' => 0, # localHeaderRelativeOffset + header length
32 @_
33 );
341019213.3ms $self->{'externalFileName'} = $externalFileName;
35101926.97ms $self->{'fh'} = $fh;
36101926.44ms $self->{'possibleEocdOffset'} = $possibleEocdOffset;
371019236.6ms return $self;
38}
39
40
# spent 226ms (145+80.7) within Archive::Zip::ZipFileMember::isDirectory which was called 20174 times, avg 11µs/call: # 10192 times (71.3ms+38.6ms) by Archive::Zip::Member::unixFileAttributes at line 356 of Archive/Zip/Member.pm, avg 11µs/call # 9982 times (73.5ms+42.1ms) by Archive::Zip::Member::_becomeDirectoryIfNecessary at line 127 of Archive/Zip/Member.pm, avg 12µs/call
sub isDirectory {
41201748.81ms my $self = shift;
42 return (
4320174131ms2155580.7ms substr( $self->fileName, -1, 1 ) eq '/'
# spent 77.4ms making 20174 calls to Archive::Zip::Member::fileName, avg 4µs/call # spent 3.29ms making 1381 calls to Archive::Zip::Member::uncompressedSize, avg 2µs/call
44 and
45 $self->uncompressedSize == 0
46 );
47}
48
49# Seek to the beginning of the local header, just past the signature.
50# Verify that the local header signature is in fact correct.
51# Update the localHeaderRelativeOffset if necessary by adding the possibleEocdOffset.
52# Returns status.
53
54
# spent 1.10s (325ms+780ms) within Archive::Zip::ZipFileMember::_seekToLocalHeader which was called 9982 times, avg 111µs/call: # 8601 times (282ms+673ms) by Archive::Zip::ZipFileMember::rewindData at line 391, avg 111µs/call # 1381 times (42.9ms+107ms) by Archive::Zip::ZipFileMember::_become at line 106, avg 108µs/call
sub _seekToLocalHeader {
5599824.90ms my $self = shift;
5699825.33ms my $where = shift; # optional
5799824.30ms my $previousWhere = shift; # optional
58
59998228.2ms998223.2ms $where = $self->localHeaderRelativeOffset() unless defined($where);
# spent 23.2ms making 9982 calls to Archive::Zip::ZipFileMember::localHeaderRelativeOffset, avg 2µs/call
60
61 # avoid loop on certain corrupt files (from Julian Field)
6299825.60ms return _formatError("corrupt zip file")
63 if defined($previousWhere) && $where == $previousWhere;
64
6599823.68ms my $status;
6699823.51ms my $signature;
67
68998254.1ms19964214ms $status = $self->fh()->seek( $where, IO::Seekable::SEEK_SET );
# spent 115ms making 9982 calls to IO::Seekable::seek, avg 11µs/call # spent 99.2ms making 9982 calls to Archive::Zip::FileMember::fh, avg 10µs/call
6999824.07ms return _ioError("seeking to local header") unless $status;
70
71998289.3ms29946543ms ( $status, $signature ) =
# spent 414ms making 9982 calls to Archive::Zip::_readSignature, avg 41µs/call # spent 101ms making 9982 calls to Archive::Zip::FileMember::fh, avg 10µs/call # spent 27.6ms making 9982 calls to Archive::Zip::FileMember::externalFileName, avg 3µs/call
72 _readSignature( $self->fh(), $self->externalFileName(),
73 LOCAL_FILE_HEADER_SIGNATURE );
7499824.94ms return $status if $status == AZ_IO_ERROR;
75
76 # retry with EOCD offset if any was given.
7799824.36ms if ( $status == AZ_FORMAT_ERROR && $self->{'possibleEocdOffset'} ) {
78 $status = $self->_seekToLocalHeader(
79 $self->localHeaderRelativeOffset() + $self->{'possibleEocdOffset'},
80 $where
81 );
82 if ( $status == AZ_OK ) {
83 $self->{'localHeaderRelativeOffset'} +=
84 $self->{'possibleEocdOffset'};
85 $self->{'possibleEocdOffset'} = 0;
86 }
87 }
88
89998241.6ms return $status;
90}
91
92# Because I'm going to delete the file handle, read the local file
93# header if the file handle is seekable. If it isn't, I assume that
94# I've already read the local header.
95# Return ( $status, $self )
96
97
# spent 1.09s (68.7ms+1.03) within Archive::Zip::ZipFileMember::_become which was called 1381 times, avg 793µs/call: # 1381 times (68.7ms+1.03s) by Archive::Zip::Member::_becomeDirectoryIfNecessary at line 127 of Archive/Zip/Member.pm, avg 793µs/call
sub _become {
981381702µs my $self = shift;
991381802µs my $newClass = shift;
10013811.01ms return $self if ref($self) eq $newClass;
101
1021381658µs my $status = AZ_OK;
103
10413818.73ms2762598ms if ( _isSeekable( $self->fh() ) ) {
# spent 514ms making 1381 calls to Archive::Zip::FileMember::fh, avg 373µs/call # spent 83.1ms making 1381 calls to Archive::Zip::_isSeekable, avg 60µs/call
10513816.91ms276223.1ms my $here = $self->fh()->tell();
# spent 15.2ms making 1381 calls to Archive::Zip::FileMember::fh, avg 11µs/call # spent 7.97ms making 1381 calls to IO::Seekable::tell, avg 6µs/call
10613813.89ms1381150ms $status = $self->_seekToLocalHeader();
# spent 150ms making 1381 calls to Archive::Zip::ZipFileMember::_seekToLocalHeader, avg 108µs/call
10713814.50ms1381162ms $status = $self->_readLocalFileHeader() if $status == AZ_OK;
# spent 162ms making 1381 calls to Archive::Zip::ZipFileMember::_readLocalFileHeader, avg 117µs/call
10813816.36ms276231.2ms $self->fh()->seek( $here, IO::Seekable::SEEK_SET );
# spent 17.3ms making 1381 calls to IO::Seekable::seek, avg 13µs/call # spent 13.9ms making 1381 calls to Archive::Zip::FileMember::fh, avg 10µs/call
10913811.19ms return $status unless $status == AZ_OK;
110 }
111
11213811.53ms delete( $self->{'eocdCrc32'} );
1131381880µs delete( $self->{'diskNumberStart'} );
1141381936µs delete( $self->{'localHeaderRelativeOffset'} );
1151381777µs delete( $self->{'dataOffset'} );
116
117138114.8ms138162.4ms return $self->SUPER::_become($newClass);
# spent 62.4ms making 1381 calls to Archive::Zip::FileMember::_become, avg 45µs/call
118}
119
120sub diskNumberStart {
121 shift->{'diskNumberStart'};
122}
123
124
# spent 23.2ms within Archive::Zip::ZipFileMember::localHeaderRelativeOffset which was called 9982 times, avg 2µs/call: # 9982 times (23.2ms+0s) by Archive::Zip::ZipFileMember::_seekToLocalHeader at line 59, avg 2µs/call
sub localHeaderRelativeOffset {
125998241.5ms shift->{'localHeaderRelativeOffset'};
126}
127
128
# spent 19.8ms within Archive::Zip::ZipFileMember::dataOffset which was called 8601 times, avg 2µs/call: # 8601 times (19.8ms+0s) by Archive::Zip::ZipFileMember::rewindData at line 399, avg 2µs/call
sub dataOffset {
129860132.6ms shift->{'dataOffset'};
130}
131
132# Skip local file header, updating only extra field stuff.
133# Assumes that fh is positioned before signature.
134
# spent 827ms (300+526) within Archive::Zip::ZipFileMember::_skipLocalFileHeader which was called 8601 times, avg 96µs/call: # 8601 times (300ms+526ms) by Archive::Zip::ZipFileMember::rewindData at line 395, avg 96µs/call
sub _skipLocalFileHeader {
13586014.53ms my $self = shift;
13686013.25ms my $header;
137860139.2ms17202142ms my $bytesRead = $self->fh()->read( $header, LOCAL_FILE_HEADER_LENGTH );
# spent 87.7ms making 8601 calls to Archive::Zip::FileMember::fh, avg 10µs/call # spent 54.5ms making 8601 calls to IO::Handle::read, avg 6µs/call
13886014.20ms if ( $bytesRead != LOCAL_FILE_HEADER_LENGTH ) {
139 return _ioError("reading local file header");
140 }
14186013.33ms my $fileNameLength;
14286013.07ms my $extraFieldLength;
14386012.95ms my $bitFlag;
144 (
145 undef, # $self->{'versionNeededToExtract'},
146860153.7ms860117.8ms $bitFlag,
# spent 17.8ms making 8601 calls to Archive::Zip::ZipFileMember::CORE:unpack, avg 2µs/call
147 undef, # $self->{'compressionMethod'},
148 undef, # $self->{'lastModFileDateTime'},
149 undef, # $crc32,
150 undef, # $compressedSize,
151 undef, # $uncompressedSize,
152 $fileNameLength,
153 $extraFieldLength
154 ) = unpack( LOCAL_FILE_HEADER_FORMAT, $header );
155
156860144.5ms17202204ms if ($fileNameLength) {
# spent 116ms making 8601 calls to IO::Seekable::seek, avg 13µs/call # spent 88.0ms making 8601 calls to Archive::Zip::FileMember::fh, avg 10µs/call
157 $self->fh()->seek( $fileNameLength, IO::Seekable::SEEK_CUR )
158 or return _ioError("skipping local file name");
159 }
160
16186014.24ms if ($extraFieldLength) {
1628224.50ms164422.7ms $bytesRead =
# spent 14.4ms making 822 calls to IO::Handle::read, avg 18µs/call # spent 8.25ms making 822 calls to Archive::Zip::FileMember::fh, avg 10µs/call
163 $self->fh()->read( $self->{'localExtraField'}, $extraFieldLength );
164822681µs if ( $bytesRead != $extraFieldLength ) {
165 return _ioError("reading local extra field");
166 }
167 }
168
169860144.4ms17202139ms $self->{'dataOffset'} = $self->fh()->tell();
# spent 86.9ms making 8601 calls to Archive::Zip::FileMember::fh, avg 10µs/call # spent 52.6ms making 8601 calls to IO::Seekable::tell, avg 6µs/call
170
17186015.18ms if ( $bitFlag & GPBF_HAS_DATA_DESCRIPTOR_MASK ) {
172
173 # Read the crc32, compressedSize, and uncompressedSize from the
174 # extended data descriptor, which directly follows the compressed data.
175 #
176 # Skip over the compressed file data (assumes that EOCD compressedSize
177 # was correct)
178 $self->fh()->seek( $self->{'compressedSize'}, IO::Seekable::SEEK_CUR )
179 or return _ioError("seeking to extended local header");
180
181 # these values should be set correctly from before.
182 my $oldCrc32 = $self->{'eocdCrc32'};
183 my $oldCompressedSize = $self->{'compressedSize'};
184 my $oldUncompressedSize = $self->{'uncompressedSize'};
185
186 my $status = $self->_readDataDescriptor();
187 return $status unless $status == AZ_OK;
188
189 return _formatError(
190 "CRC or size mismatch while skipping data descriptor")
191 if ( $oldCrc32 != $self->{'crc32'}
192 || $oldUncompressedSize != $self->{'uncompressedSize'} );
193 }
194
195860135.3ms return AZ_OK;
196}
197
198# Read from a local file header into myself. Returns AZ_OK if successful.
199# Assumes that fh is positioned after signature.
200# Note that crc32, compressedSize, and uncompressedSize will be 0 if
201# GPBF_HAS_DATA_DESCRIPTOR_MASK is set in the bitFlag.
202
203
# spent 162ms (64.7+97.5) within Archive::Zip::ZipFileMember::_readLocalFileHeader which was called 1381 times, avg 117µs/call: # 1381 times (64.7ms+97.5ms) by Archive::Zip::ZipFileMember::_become at line 107, avg 117µs/call
sub _readLocalFileHeader {
2041381746µs my $self = shift;
2051381518µs my $header;
20613816.14ms276223.0ms my $bytesRead = $self->fh()->read( $header, LOCAL_FILE_HEADER_LENGTH );
# spent 14.3ms making 1381 calls to Archive::Zip::FileMember::fh, avg 10µs/call # spent 8.70ms making 1381 calls to IO::Handle::read, avg 6µs/call
2071381679µs if ( $bytesRead != LOCAL_FILE_HEADER_LENGTH ) {
208 return _ioError("reading local file header");
209 }
2101381528µs my $fileNameLength;
2111381513µs my $crc32;
2121381480µs my $compressedSize;
2131381463µs my $uncompressedSize;
2141381463µs my $extraFieldLength;
215 (
216138110.5ms13812.63ms $self->{'versionNeededToExtract'}, $self->{'bitFlag'},
# spent 2.63ms making 1381 calls to Archive::Zip::ZipFileMember::CORE:unpack, avg 2µs/call
217 $self->{'compressionMethod'}, $self->{'lastModFileDateTime'},
218 $crc32, $compressedSize,
219 $uncompressedSize, $fileNameLength,
220 $extraFieldLength
221 ) = unpack( LOCAL_FILE_HEADER_FORMAT, $header );
222
22313811.21ms if ($fileNameLength) {
2241381498µs my $fileName;
22513816.69ms276222.8ms $bytesRead = $self->fh()->read( $fileName, $fileNameLength );
# spent 14.3ms making 1381 calls to Archive::Zip::FileMember::fh, avg 10µs/call # spent 8.50ms making 1381 calls to IO::Handle::read, avg 6µs/call
2261381639µs if ( $bytesRead != $fileNameLength ) {
227 return _ioError("reading local file name");
228 }
22913813.93ms138122.1ms $self->fileName($fileName);
# spent 22.1ms making 1381 calls to Archive::Zip::Member::fileName, avg 16µs/call
230 }
231
2321381554µs if ($extraFieldLength) {
233210µs433µs $bytesRead =
# spent 20µs making 2 calls to Archive::Zip::FileMember::fh, avg 10µs/call # spent 13µs making 2 calls to IO::Handle::read, avg 7µs/call
234 $self->fh()->read( $self->{'localExtraField'}, $extraFieldLength );
23521µs if ( $bytesRead != $extraFieldLength ) {
236 return _ioError("reading local extra field");
237 }
238 }
239
24013816.81ms276222.0ms $self->{'dataOffset'} = $self->fh()->tell();
# spent 14.4ms making 1381 calls to Archive::Zip::FileMember::fh, avg 10µs/call # spent 7.67ms making 1381 calls to IO::Seekable::tell, avg 6µs/call
241
24213814.37ms13814.86ms if ( $self->hasDataDescriptor() ) {
# spent 4.86ms making 1381 calls to Archive::Zip::Member::hasDataDescriptor, avg 4µs/call
243
244 # Read the crc32, compressedSize, and uncompressedSize from the
245 # extended data descriptor.
246 # Skip over the compressed file data (assumes that EOCD compressedSize
247 # was correct)
248 $self->fh()->seek( $self->{'compressedSize'}, IO::Seekable::SEEK_CUR )
249 or return _ioError("seeking to extended local header");
250
251 my $status = $self->_readDataDescriptor();
252 return $status unless $status == AZ_OK;
253 }
254 else {
25513811.59ms return _formatError(
256 "CRC or size mismatch after reading data descriptor")
257 if ( $self->{'crc32'} != $crc32
258 || $self->{'uncompressedSize'} != $uncompressedSize );
259 }
260
26113815.47ms return AZ_OK;
262}
263
264# This will read the data descriptor, which is after the end of compressed file
265# data in members that that have GPBF_HAS_DATA_DESCRIPTOR_MASK set in their
266# bitFlag.
267# The only reliable way to find these is to rely on the EOCD compressedSize.
268# Assumes that file is positioned immediately after the compressed data.
269# Returns status; sets crc32, compressedSize, and uncompressedSize.
270sub _readDataDescriptor {
271 my $self = shift;
272 my $signatureData;
273 my $header;
274 my $crc32;
275 my $compressedSize;
276 my $uncompressedSize;
277
278 my $bytesRead = $self->fh()->read( $signatureData, SIGNATURE_LENGTH );
279 return _ioError("reading header signature")
280 if $bytesRead != SIGNATURE_LENGTH;
281 my $signature = unpack( SIGNATURE_FORMAT, $signatureData );
282
283 # unfortunately, the signature appears to be optional.
284 if ( $signature == DATA_DESCRIPTOR_SIGNATURE
285 && ( $signature != $self->{'crc32'} ) )
286 {
287 $bytesRead = $self->fh()->read( $header, DATA_DESCRIPTOR_LENGTH );
288 return _ioError("reading data descriptor")
289 if $bytesRead != DATA_DESCRIPTOR_LENGTH;
290
291 ( $crc32, $compressedSize, $uncompressedSize ) =
292 unpack( DATA_DESCRIPTOR_FORMAT, $header );
293 }
294 else {
295 $bytesRead =
296 $self->fh()->read( $header, DATA_DESCRIPTOR_LENGTH_NO_SIG );
297 return _ioError("reading data descriptor")
298 if $bytesRead != DATA_DESCRIPTOR_LENGTH_NO_SIG;
299
300 $crc32 = $signature;
301 ( $compressedSize, $uncompressedSize ) =
302 unpack( DATA_DESCRIPTOR_FORMAT_NO_SIG, $header );
303 }
304
305 $self->{'eocdCrc32'} = $self->{'crc32'}
306 unless defined( $self->{'eocdCrc32'} );
307 $self->{'crc32'} = $crc32;
308 $self->{'compressedSize'} = $compressedSize;
309 $self->{'uncompressedSize'} = $uncompressedSize;
310
311 return AZ_OK;
312}
313
314# Read a Central Directory header. Return AZ_OK on success.
315# Assumes that fh is positioned right after the signature.
316
317
# spent 718ms (371+347) within Archive::Zip::ZipFileMember::_readCentralDirectoryFileHeader which was called 9982 times, avg 72µs/call: # 9982 times (371ms+347ms) by Archive::Zip::Archive::readFromFileHandle at line 606 of Archive/Zip/Archive.pm, avg 72µs/call
sub _readCentralDirectoryFileHeader {
31899824.86ms my $self = shift;
319998223.1ms9982105ms my $fh = $self->fh();
# spent 105ms making 9982 calls to Archive::Zip::FileMember::fh, avg 10µs/call
32099825.27ms my $header = '';
321998225.7ms998261.7ms my $bytesRead = $fh->read( $header, CENTRAL_DIRECTORY_FILE_HEADER_LENGTH );
# spent 61.7ms making 9982 calls to IO::Handle::read, avg 6µs/call
32299824.48ms if ( $bytesRead != CENTRAL_DIRECTORY_FILE_HEADER_LENGTH ) {
323 return _ioError("reading central dir header");
324 }
32599824.87ms my ( $fileNameLength, $extraFieldLength, $fileCommentLength );
326 (
3279982103ms998224.5ms $self->{'versionMadeBy'},
# spent 24.5ms making 9982 calls to Archive::Zip::ZipFileMember::CORE:unpack, avg 2µs/call
328 $self->{'fileAttributeFormat'},
329 $self->{'versionNeededToExtract'},
330 $self->{'bitFlag'},
331 $self->{'compressionMethod'},
332 $self->{'lastModFileDateTime'},
333 $self->{'crc32'},
334 $self->{'compressedSize'},
335 $self->{'uncompressedSize'},
336 $fileNameLength,
337 $extraFieldLength,
338 $fileCommentLength,
339 $self->{'diskNumberStart'},
340 $self->{'internalFileAttributes'},
341 $self->{'externalFileAttributes'},
342 $self->{'localHeaderRelativeOffset'}
343 ) = unpack( CENTRAL_DIRECTORY_FILE_HEADER_FORMAT, $header );
344
34599828.16ms $self->{'eocdCrc32'} = $self->{'crc32'};
346
34799828.34ms if ($fileNameLength) {
348998228.6ms998265.4ms $bytesRead = $fh->read( $self->{'fileName'}, $fileNameLength );
# spent 65.4ms making 9982 calls to IO::Handle::read, avg 7µs/call
34999825.46ms if ( $bytesRead != $fileNameLength ) {
350 _ioError("reading central dir filename");
351 }
352 }
35399824.05ms if ($extraFieldLength) {
3548242.19ms8245.02ms $bytesRead = $fh->read( $self->{'cdExtraField'}, $extraFieldLength );
# spent 5.02ms making 824 calls to IO::Handle::read, avg 6µs/call
355824413µs if ( $bytesRead != $extraFieldLength ) {
356 return _ioError("reading central dir extra field");
357 }
358 }
35999823.39ms if ($fileCommentLength) {
360 $bytesRead = $fh->read( $self->{'fileComment'}, $fileCommentLength );
361 if ( $bytesRead != $fileCommentLength ) {
362 return _ioError("reading central dir file comment");
363 }
364 }
365
366 # NK 10/21/04: added to avoid problems with manipulated headers
367998210.3ms if ( $self->{'uncompressedSize'} != $self->{'compressedSize'}
368 and $self->{'compressionMethod'} == COMPRESSION_STORED )
369 {
370 $self->{'uncompressedSize'} = $self->{'compressedSize'};
371 }
372
373998245.4ms1996485.3ms $self->desiredCompressionMethod( $self->compressionMethod() );
# spent 63.2ms making 9982 calls to Archive::Zip::Member::desiredCompressionMethod, avg 6µs/call # spent 22.1ms making 9982 calls to Archive::Zip::Member::compressionMethod, avg 2µs/call
374
375998239.0ms return AZ_OK;
376}
377
378
# spent 10.3s (404ms+9.90) within Archive::Zip::ZipFileMember::rewindData which was called 8601 times, avg 1.20ms/call: # 8601 times (404ms+9.90s) by Archive::Zip::Member::extractToFileHandle at line 990 of Archive/Zip/Member.pm, avg 1.20ms/call
sub rewindData {
37986014.77ms my $self = shift;
380
381860171.2ms86014.55s my $status = $self->SUPER::rewindData(@_);
# spent 4.55s making 8601 calls to Archive::Zip::Member::rewindData, avg 529µs/call
38286014.34ms return $status unless $status == AZ_OK;
383
384860124.2ms86013.27s return AZ_IO_ERROR unless $self->fh();
# spent 3.27s making 8601 calls to Archive::Zip::FileMember::fh, avg 381µs/call
385
386860166.6ms17202115ms $self->fh()->clearerr();
# spent 98.4ms making 8601 calls to Archive::Zip::FileMember::fh, avg 11µs/call # spent 16.3ms making 8601 calls to IO::Handle::clearerr, avg 2µs/call
387
388 # Seek to local file header.
389 # The only reason that I'm doing this this way is that the extraField
390 # length seems to be different between the CD header and the LF header.
391860125.4ms8601955ms $status = $self->_seekToLocalHeader();
# spent 955ms making 8601 calls to Archive::Zip::ZipFileMember::_seekToLocalHeader, avg 111µs/call
39286013.73ms return $status unless $status == AZ_OK;
393
394 # skip local file header
395860135.7ms8601827ms $status = $self->_skipLocalFileHeader();
# spent 827ms making 8601 calls to Archive::Zip::ZipFileMember::_skipLocalFileHeader, avg 96µs/call
39686014.37ms return $status unless $status == AZ_OK;
397
398 # Seek to beginning of file data
399860160.3ms25803189ms $self->fh()->seek( $self->dataOffset(), IO::Seekable::SEEK_SET )
# spent 84.9ms making 8601 calls to Archive::Zip::FileMember::fh, avg 10µs/call # spent 84.6ms making 8601 calls to IO::Seekable::seek, avg 10µs/call # spent 19.8ms making 8601 calls to Archive::Zip::ZipFileMember::dataOffset, avg 2µs/call
400 or return _ioError("seeking to beginning of file data");
401
402860133.6ms return AZ_OK;
403}
404
405# Return bytes read. Note that first parameter is a ref to a buffer.
406# my $data;
407# my ( $bytesRead, $status) = $self->readRawChunk( \$data, $chunkSize );
408
# spent 511ms (127+383) within Archive::Zip::ZipFileMember::_readRawChunk which was called 10349 times, avg 49µs/call: # 10349 times (127ms+383ms) by Archive::Zip::Member::readChunk at line 788 of Archive/Zip/Member.pm, avg 49µs/call
sub _readRawChunk {
4091034911.9ms my ( $self, $dataRef, $chunkSize ) = @_;
410103494.38ms return ( 0, AZ_OK ) unless $chunkSize;
4111034951.1ms20698383ms my $bytesRead = $self->fh()->read( $$dataRef, $chunkSize )
# spent 276ms making 10349 calls to IO::Handle::read, avg 27µs/call # spent 108ms making 10349 calls to Archive::Zip::FileMember::fh, avg 10µs/call
412 or return ( 0, _ioError("reading data") );
4131034941.8ms return ( $bytesRead, AZ_OK );
414}
415
41618µs1;
 
# spent 45.0ms within Archive::Zip::ZipFileMember::CORE:unpack which was called 19964 times, avg 2µs/call: # 9982 times (24.5ms+0s) by Archive::Zip::ZipFileMember::_readCentralDirectoryFileHeader at line 327, avg 2µs/call # 8601 times (17.8ms+0s) by Archive::Zip::ZipFileMember::_skipLocalFileHeader at line 146, avg 2µs/call # 1381 times (2.63ms+0s) by Archive::Zip::ZipFileMember::_readLocalFileHeader at line 216, avg 2µs/call
sub Archive::Zip::ZipFileMember::CORE:unpack; # opcode