← Index
NYTProf Performance Profile   « line view »
For /Users/brian/bin/perls/cpan5.26.1
  Run on Sat Dec 30 01:41:10 2017
Reported on Sat Dec 30 01:44:15 2017

Filename/usr/local/perls/perl-5.26.1/lib/5.26.1/IO/Compress/RawDeflate.pm
StatementsExecuted 42 statements in 2.48ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1115.94ms6.33msIO::Compress::RawDeflate::::BEGIN@9IO::Compress::RawDeflate::BEGIN@9
1111.47ms2.39msIO::Compress::RawDeflate::::BEGIN@11IO::Compress::RawDeflate::BEGIN@11
11121µs24µsIO::Compress::RawDeflate::::BEGIN@5IO::Compress::RawDeflate::BEGIN@5
11117µs245µsIO::Compress::RawDeflate::::BEGIN@10IO::Compress::RawDeflate::BEGIN@10
11117µs163µsIO::Compress::RawDeflate::::BEGIN@119IO::Compress::RawDeflate::BEGIN@119
11112µs54µsIO::Compress::RawDeflate::::BEGIN@120IO::Compress::RawDeflate::BEGIN@120
11112µs22µsIO::Compress::RawDeflate::::BEGIN@6IO::Compress::RawDeflate::BEGIN@6
11111µs37µsIO::Compress::RawDeflate::::BEGIN@150IO::Compress::RawDeflate::BEGIN@150
1118µs10µsIO::Compress::RawDeflate::::BEGIN@7IO::Compress::RawDeflate::BEGIN@7
0000s0sIO::Compress::RawDeflate::::ckParamsIO::Compress::RawDeflate::ckParams
0000s0sIO::Compress::RawDeflate::::createMergeIO::Compress::RawDeflate::createMerge
0000s0sIO::Compress::RawDeflate::::deflateParamsIO::Compress::RawDeflate::deflateParams
0000s0sIO::Compress::RawDeflate::::getExtraParamsIO::Compress::RawDeflate::getExtraParams
0000s0sIO::Compress::RawDeflate::::getFileInfoIO::Compress::RawDeflate::getFileInfo
0000s0sIO::Compress::RawDeflate::::getInverseClassIO::Compress::RawDeflate::getInverseClass
0000s0sIO::Compress::RawDeflate::::getZlibParamsIO::Compress::RawDeflate::getZlibParams
0000s0sIO::Compress::RawDeflate::::mkCompIO::Compress::RawDeflate::mkComp
0000s0sIO::Compress::RawDeflate::::mkFinalTrailerIO::Compress::RawDeflate::mkFinalTrailer
0000s0sIO::Compress::RawDeflate::::mkHeaderIO::Compress::RawDeflate::mkHeader
0000s0sIO::Compress::RawDeflate::::mkTrailerIO::Compress::RawDeflate::mkTrailer
0000s0sIO::Compress::RawDeflate::::newIO::Compress::RawDeflate::new
0000s0sIO::Compress::RawDeflate::::rawdeflateIO::Compress::RawDeflate::rawdeflate
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package IO::Compress::RawDeflate ;
2
3# create RFC1951
4#
5235µs227µs
# spent 24µs (21+3) within IO::Compress::RawDeflate::BEGIN@5 which was called: # once (21µs+3µs) by IO::Compress::Gzip::BEGIN@11 at line 5
use strict ;
# spent 24µs making 1 call to IO::Compress::RawDeflate::BEGIN@5 # spent 3µs making 1 call to strict::import
6229µs232µs
# spent 22µs (12+10) within IO::Compress::RawDeflate::BEGIN@6 which was called: # once (12µs+10µs) by IO::Compress::Gzip::BEGIN@11 at line 6
use warnings;
# spent 22µs making 1 call to IO::Compress::RawDeflate::BEGIN@6 # spent 10µs making 1 call to warnings::import
7233µs212µs
# spent 10µs (8+2) within IO::Compress::RawDeflate::BEGIN@7 which was called: # once (8µs+2µs) by IO::Compress::Gzip::BEGIN@11 at line 7
use bytes;
# spent 10µs making 1 call to IO::Compress::RawDeflate::BEGIN@7 # spent 2µs making 1 call to bytes::import
8
93505µs36.36ms
# spent 6.33ms (5.94+384µs) within IO::Compress::RawDeflate::BEGIN@9 which was called: # once (5.94ms+384µs) by IO::Compress::Gzip::BEGIN@11 at line 9
use IO::Compress::Base 2.074 ;
# spent 6.33ms making 1 call to IO::Compress::RawDeflate::BEGIN@9 # spent 24µs making 1 call to Exporter::import # spent 9µs making 1 call to version::_VERSION
10359µs3473µs
# spent 245µs (17+228) within IO::Compress::RawDeflate::BEGIN@10 which was called: # once (17µs+228µs) by IO::Compress::Gzip::BEGIN@11 at line 10
use IO::Compress::Base::Common 2.074 qw(:Status );
# spent 245µs making 1 call to IO::Compress::RawDeflate::BEGIN@10 # spent 219µs making 1 call to Exporter::import # spent 9µs making 1 call to version::_VERSION
1131.06ms32.66ms
# spent 2.39ms (1.47+925µs) within IO::Compress::RawDeflate::BEGIN@11 which was called: # once (1.47ms+925µs) by IO::Compress::Gzip::BEGIN@11 at line 11
use IO::Compress::Adapter::Deflate 2.074 ;
# spent 2.39ms making 1 call to IO::Compress::RawDeflate::BEGIN@11 # spent 249µs making 1 call to Exporter::import # spent 14µs making 1 call to version::_VERSION
12
1311µsrequire Exporter ;
14
15our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
16
1710s$VERSION = '2.074';
1811µs$RawDeflateError = '';
19
20112µs@ISA = qw(IO::Compress::Base Exporter);
2111µs@EXPORT_OK = qw( $RawDeflateError rawdeflate ) ;
2216µspush @EXPORT_OK, @IO::Compress::Adapter::Deflate::EXPORT_OK ;
23
2414µs%EXPORT_TAGS = %IO::Compress::Adapter::Deflate::DEFLATE_CONSTANTS;
25
26
27{
2820s my %seen;
2912µs foreach (keys %EXPORT_TAGS )
30 {
31 push @{$EXPORT_TAGS{constants}},
32 grep { !$seen{$_}++ }
33421µs @{ $EXPORT_TAGS{$_} }
34 }
3512µs $EXPORT_TAGS{all} = $EXPORT_TAGS{constants} ;
36}
37
38
3912µs%DEFLATE_CONSTANTS = %EXPORT_TAGS;
40
41#push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
42
4319µs134µsExporter::export_ok_tags('all');
# spent 34µs making 1 call to Exporter::export_ok_tags
44
45
46
47sub new
48{
49 my $class = shift ;
50
51 my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$RawDeflateError);
52
53 return $obj->_create(undef, @_);
54}
55
56sub rawdeflate
57{
58 my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$RawDeflateError);
59 return $obj->_def(@_);
60}
61
62sub ckParams
63{
64 my $self = shift ;
65 my $got = shift;
66
67 return 1 ;
68}
69
70sub mkComp
71{
72 my $self = shift ;
73 my $got = shift ;
74
75 my ($obj, $errstr, $errno) = IO::Compress::Adapter::Deflate::mkCompObject(
76 $got->getValue('crc32'),
77 $got->getValue('adler32'),
78 $got->getValue('level'),
79 $got->getValue('strategy')
80 );
81
82 return $self->saveErrorString(undef, $errstr, $errno)
83 if ! defined $obj;
84
85 return $obj;
86}
87
88
89sub mkHeader
90{
91 my $self = shift ;
92 return '';
93}
94
95sub mkTrailer
96{
97 my $self = shift ;
98 return '';
99}
100
101sub mkFinalTrailer
102{
103 return '';
104}
105
106
107#sub newHeader
108#{
109# my $self = shift ;
110# return '';
111#}
112
113sub getExtraParams
114{
115 my $self = shift ;
116 return getZlibParams();
117}
118
119361µs3309µs
# spent 163µs (17+146) within IO::Compress::RawDeflate::BEGIN@119 which was called: # once (17µs+146µs) by IO::Compress::Gzip::BEGIN@11 at line 119
use IO::Compress::Base::Common 2.074 qw(:Parse);
# spent 163µs making 1 call to IO::Compress::RawDeflate::BEGIN@119 # spent 136µs making 1 call to Exporter::import # spent 10µs making 1 call to version::_VERSION
1203189µs396µs
# spent 54µs (12+42) within IO::Compress::RawDeflate::BEGIN@120 which was called: # once (12µs+42µs) by IO::Compress::Gzip::BEGIN@11 at line 120
use Compress::Raw::Zlib 2.074 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
# spent 54µs making 1 call to IO::Compress::RawDeflate::BEGIN@120 # spent 32µs making 1 call to Exporter::import # spent 10µs making 1 call to version::_VERSION
121116µs27µsour %PARAMS = (
# spent 7µs making 2 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:114], avg 4µs/call
122 #'method' => [IO::Compress::Base::Common::Parse_unsigned, Z_DEFLATED],
123 'level' => [IO::Compress::Base::Common::Parse_signed, Z_DEFAULT_COMPRESSION],
124 'strategy' => [IO::Compress::Base::Common::Parse_signed, Z_DEFAULT_STRATEGY],
125
126 'crc32' => [IO::Compress::Base::Common::Parse_boolean, 0],
127 'adler32' => [IO::Compress::Base::Common::Parse_boolean, 0],
128 'merge' => [IO::Compress::Base::Common::Parse_boolean, 0],
129 );
130
131sub getZlibParams
132{
133 return %PARAMS;
134}
135
136sub getInverseClass
137{
138 return ('IO::Uncompress::RawInflate',
139 \$IO::Uncompress::RawInflate::RawInflateError);
140}
141
142sub getFileInfo
143{
144 my $self = shift ;
145 my $params = shift;
146 my $file = shift ;
147
148}
149
1502409µs263µs
# spent 37µs (11+26) within IO::Compress::RawDeflate::BEGIN@150 which was called: # once (11µs+26µs) by IO::Compress::Gzip::BEGIN@11 at line 150
use Fcntl qw(SEEK_SET);
# spent 37µs making 1 call to IO::Compress::RawDeflate::BEGIN@150 # spent 26µs making 1 call to Exporter::import
151
152sub createMerge
153{
154 my $self = shift ;
155 my $outValue = shift ;
156 my $outType = shift ;
157
158 my ($invClass, $error_ref) = $self->getInverseClass();
159 eval "require $invClass"
160 or die "aaaahhhh" ;
161
162 my $inf = $invClass->new( $outValue,
163 Transparent => 0,
164 #Strict => 1,
165 AutoClose => 0,
166 Scan => 1)
167 or return $self->saveErrorString(undef, "Cannot create InflateScan object: $$error_ref" ) ;
168
169 my $end_offset = 0;
170 $inf->scan()
171 or return $self->saveErrorString(undef, "Error Scanning: $$error_ref", $inf->errorNo) ;
172 $inf->zap($end_offset)
173 or return $self->saveErrorString(undef, "Error Zapping: $$error_ref", $inf->errorNo) ;
174
175 my $def = *$self->{Compress} = $inf->createDeflate();
176
177 *$self->{Header} = *$inf->{Info}{Header};
178 *$self->{UnCompSize} = *$inf->{UnCompSize}->clone();
179 *$self->{CompSize} = *$inf->{CompSize}->clone();
180 # TODO -- fix this
181 #*$self->{CompSize} = new U64(0, *$self->{UnCompSize_32bit});
182
183
184 if ( $outType eq 'buffer')
185 { substr( ${ *$self->{Buffer} }, $end_offset) = '' }
186 elsif ($outType eq 'handle' || $outType eq 'filename') {
187 *$self->{FH} = *$inf->{FH} ;
188 delete *$inf->{FH};
189 *$self->{FH}->flush() ;
190 *$self->{Handle} = 1 if $outType eq 'handle';
191
192 #seek(*$self->{FH}, $end_offset, SEEK_SET)
193 *$self->{FH}->seek($end_offset, SEEK_SET)
194 or return $self->saveErrorString(undef, $!, $!) ;
195 }
196
197 return $def ;
198}
199
200#### zlib specific methods
201
202sub deflateParams
203{
204 my $self = shift ;
205
206 my $level = shift ;
207 my $strategy = shift ;
208
209 my $status = *$self->{Compress}->deflateParams(Level => $level, Strategy => $strategy) ;
210 return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo})
211 if $status == STATUS_ERROR;
212
213 return 1;
214}
215
- -
219126µs1;
220
221__END__