← Index
NYTProf Performance Profile   « line view »
For t/bug-md-11.t
  Run on Fri Mar 8 13:27:24 2024
Reported on Fri Mar 8 13:30:23 2024

Filename/home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Archive/Zip/StringMember.pm
StatementsExecuted 9 statements in 240µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11110µs11µsArchive::Zip::StringMember::::BEGIN@3Archive::Zip::StringMember::BEGIN@3
1116µs6µsArchive::Zip::StringMember::::BEGIN@6Archive::Zip::StringMember::BEGIN@6
1114µs22µsArchive::Zip::StringMember::::BEGIN@4Archive::Zip::StringMember::BEGIN@4
1113µs88µsArchive::Zip::StringMember::::BEGIN@11Archive::Zip::StringMember::BEGIN@11
0000s0sArchive::Zip::StringMember::::_becomeArchive::Zip::StringMember::_become
0000s0sArchive::Zip::StringMember::::_newFromStringArchive::Zip::StringMember::_newFromString
0000s0sArchive::Zip::StringMember::::_readRawChunkArchive::Zip::StringMember::_readRawChunk
0000s0sArchive::Zip::StringMember::::contentsArchive::Zip::StringMember::contents
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::StringMember;
2
3236µs213µs
# spent 11µs (10+2) within Archive::Zip::StringMember::BEGIN@3 which was called: # once (10µs+2µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 3
use strict;
# spent 11µs making 1 call to Archive::Zip::StringMember::BEGIN@3 # spent 2µs making 1 call to strict::import
4223µs239µs
# spent 22µs (4+18) within Archive::Zip::StringMember::BEGIN@4 which was called: # once (4µs+18µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 4
use vars qw( $VERSION @ISA );
# spent 22µs making 1 call to Archive::Zip::StringMember::BEGIN@4 # spent 18µs making 1 call to vars::import
5
6
# spent 6µs within Archive::Zip::StringMember::BEGIN@6 which was called: # once (6µs+0s) by Spreadsheet::ParseXLSX::BEGIN@11 at line 9
BEGIN {
71200ns $VERSION = '1.68';
817µs @ISA = qw( Archive::Zip::Member );
9114µs16µs}
# spent 6µs making 1 call to Archive::Zip::StringMember::BEGIN@6
10
1112µs185µs
# spent 88µs (3+85) within Archive::Zip::StringMember::BEGIN@11 which was called: # once (3µs+85µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 14
use Archive::Zip qw(
# spent 85µs making 1 call to Exporter::import
12 :CONSTANTS
13 :ERROR_CODES
141157µs188µs);
# spent 88µs making 1 call to Archive::Zip::StringMember::BEGIN@11
15
16# Create a new string member. Default is COMPRESSION_STORED.
17# Can take a ref to a string as well.
18sub _newFromString {
19 my $class = shift;
20 my $string = shift;
21 my $name = shift;
22 my $self = $class->new(@_);
23 $self->contents($string);
24 $self->fileName($name) if defined($name);
25
26 # Set the file date to now
27 $self->setLastModFileDateTimeFromUnix(time());
28 $self->unixFileAttributes($self->DEFAULT_FILE_PERMISSIONS);
29 return $self;
30}
31
32sub _become {
33 my $self = shift;
34 my $newClass = shift;
35 return $self if ref($self) eq $newClass;
36 delete($self->{'contents'});
37 return $self->SUPER::_become($newClass);
38}
39
40# Get or set my contents. Note that we do not call the superclass
41# version of this, because it calls us.
42sub contents {
43 my $self = shift;
44 my $string = shift;
45 if (defined($string)) {
46 $self->{'contents'} =
47 pack('C0a*', (ref($string) eq 'SCALAR') ? $$string : $string);
48 $self->{'uncompressedSize'} = $self->{'compressedSize'} =
49 length($self->{'contents'});
50 $self->{'compressionMethod'} = COMPRESSION_STORED;
51 }
52 return wantarray ? ($self->{'contents'}, AZ_OK) : $self->{'contents'};
53}
54
55# Return bytes read. Note that first parameter is a ref to a buffer.
56# my $data;
57# my ( $bytesRead, $status) = $self->readRawChunk( \$data, $chunkSize );
58sub _readRawChunk {
59 my ($self, $dataRef, $chunkSize) = @_;
60 $$dataRef = substr($self->contents(), $self->_readOffset(), $chunkSize);
61 return (length($$dataRef), AZ_OK);
62}
63
6412µs1;