← 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/x86_64-linux/Compress/Raw/Zlib.pm
StatementsExecuted 1999 statements in 3.16ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
71112.1ms12.1msCompress::Raw::Zlib::inflateStream::::inflate Compress::Raw::Zlib::inflateStream::inflate (xsub)
111850µs965µsCompress::Raw::Zlib::::BEGIN@113 Compress::Raw::Zlib::BEGIN@113
711295µs450µsCompress::Raw::Zlib::Parameters::::parse Compress::Raw::Zlib::Parameters::parse
111188µs228µsCompress::Raw::Zlib::::BEGIN@10 Compress::Raw::Zlib::BEGIN@10
7021127µs145µsCompress::Raw::Zlib::Parameters::::_checkType Compress::Raw::Zlib::Parameters::_checkType
711120µs722µsCompress::Raw::Zlib::Inflate::::new Compress::Raw::Zlib::Inflate::new
638149µs49µsCompress::Raw::Zlib::Parameters::::value Compress::Raw::Zlib::Parameters::value
71147µs510µsCompress::Raw::Zlib::::ParseParameters Compress::Raw::Zlib::ParseParameters
73244µs58µsCompress::Raw::Zlib::::AUTOLOAD Compress::Raw::Zlib::AUTOLOAD
71140µs40µsCompress::Raw::Zlib::::_inflateInit Compress::Raw::Zlib::_inflateInit (xsub)
558232µs32µsCompress::Raw::Zlib::::__ANON__[:122] Compress::Raw::Zlib::__ANON__[:122]
71125µs25µsCompress::Raw::Zlib::inflateStream::::DESTROY Compress::Raw::Zlib::inflateStream::DESTROY (xsub)
11114µs28µsCompress::Raw::Zlib::::BEGIN@155 Compress::Raw::Zlib::BEGIN@155
71113µs13µsCompress::Raw::Zlib::Parameters::::new Compress::Raw::Zlib::Parameters::new
1118µs42µsCompress::Raw::Zlib::::BEGIN@6 Compress::Raw::Zlib::BEGIN@6
1115µs9µsCompress::Raw::Zlib::::BEGIN@121 Compress::Raw::Zlib::BEGIN@121
7114µs4µsCompress::Raw::Zlib::::constant Compress::Raw::Zlib::constant (xsub)
1114µs5µsCompress::Raw::Zlib::::BEGIN@8 Compress::Raw::Zlib::BEGIN@8
1114µs22µsCompress::Raw::Zlib::::BEGIN@114 Compress::Raw::Zlib::BEGIN@114
1114µs24µsCompress::Raw::Zlib::::BEGIN@126 Compress::Raw::Zlib::BEGIN@126
1114µs21µsCompress::Raw::Zlib::::BEGIN@144 Compress::Raw::Zlib::BEGIN@144
1113µs21µsCompress::Raw::Zlib::::BEGIN@130 Compress::Raw::Zlib::BEGIN@130
1113µs18µsCompress::Raw::Zlib::::BEGIN@127 Compress::Raw::Zlib::BEGIN@127
1113µs19µsCompress::Raw::Zlib::::BEGIN@146 Compress::Raw::Zlib::BEGIN@146
1113µs17µsCompress::Raw::Zlib::::BEGIN@129 Compress::Raw::Zlib::BEGIN@129
1113µs36µsCompress::Raw::Zlib::::BEGIN@145 Compress::Raw::Zlib::BEGIN@145
1113µs18µsCompress::Raw::Zlib::::BEGIN@147 Compress::Raw::Zlib::BEGIN@147
1113µs17µsCompress::Raw::Zlib::::BEGIN@128 Compress::Raw::Zlib::BEGIN@128
1113µs16µsCompress::Raw::Zlib::::BEGIN@154 Compress::Raw::Zlib::BEGIN@154
1113µs19µsCompress::Raw::Zlib::::BEGIN@9 Compress::Raw::Zlib::BEGIN@9
1113µs18µsCompress::Raw::Zlib::::BEGIN@157 Compress::Raw::Zlib::BEGIN@157
1113µs16µsCompress::Raw::Zlib::::BEGIN@158 Compress::Raw::Zlib::BEGIN@158
1113µs16µsCompress::Raw::Zlib::::BEGIN@153 Compress::Raw::Zlib::BEGIN@153
1112µs15µsCompress::Raw::Zlib::::BEGIN@156 Compress::Raw::Zlib::BEGIN@156
0000s0sCompress::Raw::Zlib::Deflate::::new Compress::Raw::Zlib::Deflate::new
0000s0sCompress::Raw::Zlib::InflateScan::::new Compress::Raw::Zlib::InflateScan::new
0000s0sCompress::Raw::Zlib::Parameters::::parsed Compress::Raw::Zlib::Parameters::parsed
0000s0sCompress::Raw::Zlib::Parameters::::setError Compress::Raw::Zlib::Parameters::setError
0000s0sCompress::Raw::Zlib::deflateStream::::STORABLE_freeze Compress::Raw::Zlib::deflateStream::STORABLE_freeze
0000s0sCompress::Raw::Zlib::deflateStream::::STORABLE_thaw Compress::Raw::Zlib::deflateStream::STORABLE_thaw
0000s0sCompress::Raw::Zlib::deflateStream::::deflateParams Compress::Raw::Zlib::deflateStream::deflateParams
0000s0sCompress::Raw::Zlib::inflateScanStream::::createDeflateStreamCompress::Raw::Zlib::inflateScanStream::createDeflateStream
0000s0sCompress::Raw::Zlib::inflateScanStream::::inflateCompress::Raw::Zlib::inflateScanStream::inflate
0000s0sCompress::Raw::Zlib::inflateStream::::STORABLE_freeze Compress::Raw::Zlib::inflateStream::STORABLE_freeze
0000s0sCompress::Raw::Zlib::inflateStream::::STORABLE_thaw Compress::Raw::Zlib::inflateStream::STORABLE_thaw
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2package Compress::Raw::Zlib;
3
416µsrequire 5.006 ;
51400nsrequire Exporter;
6217µs275µs
# spent 42µs (8+34) within Compress::Raw::Zlib::BEGIN@6 which was called: # once (8µs+34µs) by Archive::Zip::BEGIN@9 at line 6
use Carp ;
# spent 42µs making 1 call to Compress::Raw::Zlib::BEGIN@6 # spent 34µs making 1 call to Exporter::import
7
8214µs27µs
# spent 5µs (4+2) within Compress::Raw::Zlib::BEGIN@8 which was called: # once (4µs+2µs) by Archive::Zip::BEGIN@9 at line 8
use strict ;
# spent 5µs making 1 call to Compress::Raw::Zlib::BEGIN@8 # spent 2µs making 1 call to strict::import
9213µs235µs
# spent 19µs (3+16) within Compress::Raw::Zlib::BEGIN@9 which was called: # once (3µs+16µs) by Archive::Zip::BEGIN@9 at line 9
use warnings ;
# spent 19µs making 1 call to Compress::Raw::Zlib::BEGIN@9 # spent 16µs making 1 call to warnings::import
102204µs2230µs
# spent 228µs (188+40) within Compress::Raw::Zlib::BEGIN@10 which was called: # once (188µs+40µs) by Archive::Zip::BEGIN@9 at line 10
use bytes ;
# spent 228µs making 1 call to Compress::Raw::Zlib::BEGIN@10 # spent 2µs making 1 call to bytes::import
11our ($VERSION, $XS_VERSION, @ISA, @EXPORT, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD, %DEFLATE_CONSTANTS, @DEFLATE_CONSTANTS);
12
131300ns$VERSION = '2.209';
141100ns$XS_VERSION = $VERSION;
15111µs$VERSION = eval $VERSION;
# spent 2µs executing statements in string eval
16
1715µs@ISA = qw(Exporter);
1813µs%EXPORT_TAGS = ( flush => [qw{
19 Z_NO_FLUSH
20 Z_PARTIAL_FLUSH
21 Z_SYNC_FLUSH
22 Z_FULL_FLUSH
23 Z_FINISH
24 Z_BLOCK
25 }],
26 level => [qw{
27 Z_NO_COMPRESSION
28 Z_BEST_SPEED
29 Z_BEST_COMPRESSION
30 Z_DEFAULT_COMPRESSION
31 }],
32 strategy => [qw{
33 Z_FILTERED
34 Z_HUFFMAN_ONLY
35 Z_RLE
36 Z_FIXED
37 Z_DEFAULT_STRATEGY
38 }],
39 status => [qw{
40 Z_OK
41 Z_STREAM_END
42 Z_NEED_DICT
43 Z_ERRNO
44 Z_STREAM_ERROR
45 Z_DATA_ERROR
46 Z_MEM_ERROR
47 Z_BUF_ERROR
48 Z_VERSION_ERROR
49 }],
50 );
51
5211µs%DEFLATE_CONSTANTS = %EXPORT_TAGS;
53
54# Items to export into callers namespace by default. Note: do not export
55# names by default without a very good reason. Use EXPORT_OK instead.
56# Do not simply export all your public functions/methods/constants.
5714µs@DEFLATE_CONSTANTS =
58@EXPORT = qw(
59 ZLIB_VERSION
60 ZLIB_VERNUM
61
62
63 OS_CODE
64
65 MAX_MEM_LEVEL
66 MAX_WBITS
67
68 Z_ASCII
69 Z_BEST_COMPRESSION
70 Z_BEST_SPEED
71 Z_BINARY
72 Z_BLOCK
73 Z_BUF_ERROR
74 Z_DATA_ERROR
75 Z_DEFAULT_COMPRESSION
76 Z_DEFAULT_STRATEGY
77 Z_DEFLATED
78 Z_ERRNO
79 Z_FILTERED
80 Z_FIXED
81 Z_FINISH
82 Z_FULL_FLUSH
83 Z_HUFFMAN_ONLY
84 Z_MEM_ERROR
85 Z_NEED_DICT
86 Z_NO_COMPRESSION
87 Z_NO_FLUSH
88 Z_NULL
89 Z_OK
90 Z_PARTIAL_FLUSH
91 Z_RLE
92 Z_STREAM_END
93 Z_STREAM_ERROR
94 Z_SYNC_FLUSH
95 Z_TREES
96 Z_UNKNOWN
97 Z_VERSION_ERROR
98
99 ZLIBNG_VERSION
100 ZLIBNG_VERNUM
101 ZLIBNG_VER_MAJOR
102 ZLIBNG_VER_MINOR
103 ZLIBNG_VER_REVISION
104 ZLIBNG_VER_STATUS
105 ZLIBNG_VER_MODIFIED
106
107 WANT_GZIP
108 WANT_GZIP_OR_ZLIB
109);
110
1111700nspush @EXPORT, qw(crc32 adler32 DEF_WBITS);
112
113291µs2994µs
# spent 965µs (850+115) within Compress::Raw::Zlib::BEGIN@113 which was called: # once (850µs+115µs) by Archive::Zip::BEGIN@9 at line 113
use constant WANT_GZIP => 16;
# spent 965µs making 1 call to Compress::Raw::Zlib::BEGIN@113 # spent 28µs making 1 call to constant::import
114249µs241µs
# spent 22µs (4+19) within Compress::Raw::Zlib::BEGIN@114 which was called: # once (4µs+19µs) by Archive::Zip::BEGIN@9 at line 114
use constant WANT_GZIP_OR_ZLIB => 32;
# spent 22µs making 1 call to Compress::Raw::Zlib::BEGIN@114 # spent 19µs making 1 call to constant::import
115
116
# spent 58µs (44+14) within Compress::Raw::Zlib::AUTOLOAD which was called 7 times, avg 8µs/call: # 5 times (26µs+9µs) by Archive::Zip::BEGIN@9 at line 385, avg 7µs/call # once (10µs+3µs) by Archive::Zip::Member::rewindData at line 1230 of Archive/Zip/Member.pm # once (8µs+3µs) by Archive::Zip::Member::_inflateChunk at line 1186 of Archive/Zip/Member.pm
sub AUTOLOAD {
1177800ns my($constname);
118719µs710µs ($constname = $AUTOLOAD) =~ s/.*:://;
# spent 10µs making 7 calls to CORE::subst, avg 1µs/call
119713µs74µs my ($error, $val) = constant($constname);
# spent 4µs making 7 calls to Compress::Raw::Zlib::constant, avg 600ns/call
1207800ns Carp::croak $error if $error;
121249µs213µs
# spent 9µs (5+4) within Compress::Raw::Zlib::BEGIN@121 which was called: # once (5µs+4µs) by Archive::Zip::BEGIN@9 at line 121
no strict 'refs';
# spent 9µs making 1 call to Compress::Raw::Zlib::BEGIN@121 # spent 4µs making 1 call to strict::unimport
1226260µs
# spent 32µs within Compress::Raw::Zlib::__ANON__[/home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/x86_64-linux/Compress/Raw/Zlib.pm:122] which was called 55 times, avg 582ns/call: # 13 times (6µs+0s) by Archive::Zip::Member::_inflateChunk at line 1186 of Archive/Zip/Member.pm, avg 469ns/call # 7 times (8µs+0s) by Archive::Zip::Member::_inflateChunk at line 1185 of Archive/Zip/Member.pm, avg 1µs/call # 7 times (6µs+0s) by Archive::Zip::Member::rewindData at line 1225 of Archive/Zip/Member.pm, avg 829ns/call # 7 times (3µs+0s) by Compress::Raw::Zlib::Inflate::new at line 473, avg 486ns/call # 7 times (3µs+0s) by Archive::Zip::BEGIN@9 or Archive::Zip::Member::_inflateChunk or Archive::Zip::Member::rewindData at line 123, avg 429ns/call # 7 times (2µs+0s) by Archive::Zip::Member::_inflateChunk at line 1187 of Archive/Zip/Member.pm, avg 214ns/call # 6 times (4µs+0s) by Archive::Zip::Member::rewindData at line 1230 of Archive/Zip/Member.pm, avg 733ns/call # once (300ns+0s) by Archive::Zip::BEGIN@9 at line 442
*{$AUTOLOAD} = sub { $val };
123717µs73µs goto &{$AUTOLOAD};
# spent 3µs making 7 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:122], avg 429ns/call
124}
125
126215µs244µs
# spent 24µs (4+20) within Compress::Raw::Zlib::BEGIN@126 which was called: # once (4µs+20µs) by Archive::Zip::BEGIN@9 at line 126
use constant FLAG_APPEND => 1 ;
# spent 24µs making 1 call to Compress::Raw::Zlib::BEGIN@126 # spent 20µs making 1 call to constant::import
127212µs233µs
# spent 18µs (3+15) within Compress::Raw::Zlib::BEGIN@127 which was called: # once (3µs+15µs) by Archive::Zip::BEGIN@9 at line 127
use constant FLAG_CRC => 2 ;
# spent 18µs making 1 call to Compress::Raw::Zlib::BEGIN@127 # spent 15µs making 1 call to constant::import
128213µs231µs
# spent 17µs (3+14) within Compress::Raw::Zlib::BEGIN@128 which was called: # once (3µs+14µs) by Archive::Zip::BEGIN@9 at line 128
use constant FLAG_ADLER => 4 ;
# spent 17µs making 1 call to Compress::Raw::Zlib::BEGIN@128 # spent 14µs making 1 call to constant::import
129212µs230µs
# spent 17µs (3+14) within Compress::Raw::Zlib::BEGIN@129 which was called: # once (3µs+14µs) by Archive::Zip::BEGIN@9 at line 129
use constant FLAG_CONSUME_INPUT => 8 ;
# spent 17µs making 1 call to Compress::Raw::Zlib::BEGIN@129 # spent 14µs making 1 call to constant::import
130242µs239µs
# spent 21µs (3+18) within Compress::Raw::Zlib::BEGIN@130 which was called: # once (3µs+18µs) by Archive::Zip::BEGIN@9 at line 130
use constant FLAG_LIMIT_OUTPUT => 16 ;
# spent 21µs making 1 call to Compress::Raw::Zlib::BEGIN@130 # spent 18µs making 1 call to constant::import
131
132eval {
1331400ns require XSLoader;
1341176µs1170µs XSLoader::load('Compress::Raw::Zlib', $XS_VERSION);
# spent 170µs making 1 call to XSLoader::load
1351500ns 1;
136}
1371400nsor do {
138 require DynaLoader;
139 local @ISA = qw(DynaLoader);
140 bootstrap Compress::Raw::Zlib $XS_VERSION ;
141};
142
143
144213µs239µs
# spent 21µs (4+18) within Compress::Raw::Zlib::BEGIN@144 which was called: # once (4µs+18µs) by Archive::Zip::BEGIN@9 at line 144
use constant Parse_any => 0x01;
# spent 21µs making 1 call to Compress::Raw::Zlib::BEGIN@144 # spent 18µs making 1 call to constant::import
145216µs269µs
# spent 36µs (3+33) within Compress::Raw::Zlib::BEGIN@145 which was called: # once (3µs+33µs) by Archive::Zip::BEGIN@9 at line 145
use constant Parse_unsigned => 0x02;
# spent 36µs making 1 call to Compress::Raw::Zlib::BEGIN@145 # spent 33µs making 1 call to constant::import
146213µs235µs
# spent 19µs (3+16) within Compress::Raw::Zlib::BEGIN@146 which was called: # once (3µs+16µs) by Archive::Zip::BEGIN@9 at line 146
use constant Parse_signed => 0x04;
# spent 19µs making 1 call to Compress::Raw::Zlib::BEGIN@146 # spent 16µs making 1 call to constant::import
147214µs233µs
# spent 18µs (3+15) within Compress::Raw::Zlib::BEGIN@147 which was called: # once (3µs+15µs) by Archive::Zip::BEGIN@9 at line 147
use constant Parse_boolean => 0x08;
# spent 18µs making 1 call to Compress::Raw::Zlib::BEGIN@147 # spent 15µs making 1 call to constant::import
148#use constant Parse_string => 0x10;
149#use constant Parse_custom => 0x12;
150
151#use constant Parse_store_ref => 0x100 ;
152
153212µs230µs
# spent 16µs (3+14) within Compress::Raw::Zlib::BEGIN@153 which was called: # once (3µs+14µs) by Archive::Zip::BEGIN@9 at line 153
use constant OFF_PARSED => 0 ;
# spent 16µs making 1 call to Compress::Raw::Zlib::BEGIN@153 # spent 14µs making 1 call to constant::import
154212µs230µs
# spent 16µs (3+14) within Compress::Raw::Zlib::BEGIN@154 which was called: # once (3µs+14µs) by Archive::Zip::BEGIN@9 at line 154
use constant OFF_TYPE => 1 ;
# spent 16µs making 1 call to Compress::Raw::Zlib::BEGIN@154 # spent 14µs making 1 call to constant::import
155211µs241µs
# spent 28µs (14+13) within Compress::Raw::Zlib::BEGIN@155 which was called: # once (14µs+13µs) by Archive::Zip::BEGIN@9 at line 155
use constant OFF_DEFAULT => 2 ;
# spent 28µs making 1 call to Compress::Raw::Zlib::BEGIN@155 # spent 13µs making 1 call to constant::import
156211µs228µs
# spent 15µs (2+13) within Compress::Raw::Zlib::BEGIN@156 which was called: # once (2µs+13µs) by Archive::Zip::BEGIN@9 at line 156
use constant OFF_FIXED => 3 ;
# spent 15µs making 1 call to Compress::Raw::Zlib::BEGIN@156 # spent 13µs making 1 call to constant::import
157213µs233µs
# spent 18µs (3+15) within Compress::Raw::Zlib::BEGIN@157 which was called: # once (3µs+15µs) by Archive::Zip::BEGIN@9 at line 157
use constant OFF_FIRST_ONLY => 4 ;
# spent 18µs making 1 call to Compress::Raw::Zlib::BEGIN@157 # spent 15µs making 1 call to constant::import
15821.45ms228µs
# spent 16µs (3+13) within Compress::Raw::Zlib::BEGIN@158 which was called: # once (3µs+13µs) by Archive::Zip::BEGIN@9 at line 158
use constant OFF_STICKY => 5 ;
# spent 16µs making 1 call to Compress::Raw::Zlib::BEGIN@158 # spent 13µs making 1 call to constant::import
159
- -
162sub ParseParameters
163
# spent 510µs (47+463) within Compress::Raw::Zlib::ParseParameters which was called 7 times, avg 73µs/call: # 7 times (47µs+463µs) by Compress::Raw::Zlib::Inflate::new at line 458, avg 73µs/call
{
16472µs my $level = shift || 0 ;
165
166715µs my $sub = (caller($level + 1))[3] ;
167 #local $Carp::CarpLevel = 1 ;
168713µs713µs my $p = new Compress::Raw::Zlib::Parameters() ;
# spent 13µs making 7 calls to Compress::Raw::Zlib::Parameters::new, avg 2µs/call
16976µs7450µs $p->parse(@_)
# spent 450µs making 7 calls to Compress::Raw::Zlib::Parameters::parse, avg 64µs/call
170 or croak "$sub: $p->{Error}" ;
171
17278µs return $p;
173}
174
175
176sub Compress::Raw::Zlib::Parameters::new
177
# spent 13µs within Compress::Raw::Zlib::Parameters::new which was called 7 times, avg 2µs/call: # 7 times (13µs+0s) by Compress::Raw::Zlib::ParseParameters at line 168, avg 2µs/call
{
17871µs my $class = shift ;
179
18076µs my $obj = { Error => '',
181 Got => {},
182 } ;
183
184 #return bless $obj, ref($class) || $class || __PACKAGE__ ;
185710µs return bless $obj, 'Compress::Raw::Zlib::Parameters' ;
186}
187
188sub Compress::Raw::Zlib::Parameters::setError
189{
190 my $self = shift ;
191 my $error = shift ;
192 my $retval = @_ ? shift : undef ;
193
194 $self->{Error} = $error ;
195 return $retval;
196}
197
198#sub getError
199#{
200# my $self = shift ;
201# return $self->{Error} ;
202#}
203
204sub Compress::Raw::Zlib::Parameters::parse
205
# spent 450µs (295+155) within Compress::Raw::Zlib::Parameters::parse which was called 7 times, avg 64µs/call: # 7 times (295µs+155µs) by Compress::Raw::Zlib::ParseParameters at line 169, avg 64µs/call
{
20672µs my $self = shift ;
207
20871µs my $default = shift ;
209
21073µs my $got = $self->{Got} ;
21174µs my $firstTime = keys %{ $got } == 0 ;
212
2137800ns my (@Bad) ;
21472µs my @entered = () ;
215
216 # Allow the options to be passed as a hash reference or
217 # as the complete hash.
21874µs if (@_ == 0) {
219 @entered = () ;
220 }
221 elsif (@_ == 1) {
222 my $href = $_[0] ;
223 return $self->setError("Expected even number of parameters, got 1")
224 if ! defined $href or ! ref $href or ref $href ne "HASH" ;
225
226 foreach my $key (keys %$href) {
227 push @entered, $key ;
228 push @entered, \$href->{$key} ;
229 }
230 }
231 else {
23272µs my $count = @_;
23373µs return $self->setError("Expected even number of parameters, got $count")
234 if $count % 2 != 0 ;
235
236710µs for my $i (0.. $count / 2 - 1) {
237144µs push @entered, $_[2* $i] ;
238146µs push @entered, \$_[2* $i+1] ;
239 }
240 }
241
242
243732µs while (my ($key, $v) = each %$default)
244 {
245565µs croak "need 4 params [@$v]"
246 if @$v != 4 ;
247
2485613µs my ($first_only, $sticky, $type, $value) = @$v ;
249564µs my $x ;
2505627µs5690µs $self->_checkType($key, \$value, $type, 0, \$x)
# spent 90µs making 56 calls to Compress::Raw::Zlib::Parameters::_checkType, avg 2µs/call
251 or return undef ;
252
2535613µs $key = lc $key;
254
2555637µs if ($firstTime || ! $sticky) {
256 $got->{$key} = [0, $type, $value, $x, $first_only, $sticky] ;
257 }
258
2595615µs $got->{$key}[OFF_PARSED] = 0 ;
260 }
261
26276µs for my $i (0.. @entered / 2 - 1) {
263144µs my $key = $entered[2* $i] ;
264143µs my $value = $entered[2* $i+1] ;
265
266 #print "Key [$key] Value [$value]" ;
267 #print defined $$value ? "[$$value]\n" : "[undef]\n";
268
2691424µs1410µs $key =~ s/^-// ;
# spent 10µs making 14 calls to CORE::subst, avg 686ns/call
270143µs my $canonkey = lc $key;
271
272149µs if ($got->{$canonkey} && ($firstTime ||
273 ! $got->{$canonkey}[OFF_FIRST_ONLY] ))
274 {
275143µs my $type = $got->{$canonkey}[OFF_TYPE] ;
276141µs my $s ;
277148µs1455µs $self->_checkType($key, $value, $type, 1, \$s)
# spent 55µs making 14 calls to Compress::Raw::Zlib::Parameters::_checkType, avg 4µs/call
278 or return undef ;
279 #$value = $$value unless $type & Parse_store_ref ;
280142µs $value = $$value ;
2811411µs $got->{$canonkey} = [1, $type, $value, $s] ;
282 }
283 else
284 { push (@Bad, $key) }
285 }
286
28771µs if (@Bad) {
288 my ($bad) = join(", ", @Bad) ;
289 return $self->setError("unknown key value(s) @Bad") ;
290 }
291
29279µs return 1;
293}
294
295sub Compress::Raw::Zlib::Parameters::_checkType
296
# spent 145µs (127+18) within Compress::Raw::Zlib::Parameters::_checkType which was called 70 times, avg 2µs/call: # 56 times (90µs+0s) by Compress::Raw::Zlib::Parameters::parse at line 250, avg 2µs/call # 14 times (36µs+18µs) by Compress::Raw::Zlib::Parameters::parse at line 277, avg 4µs/call
{
297706µs my $self = shift ;
298
299708µs my $key = shift ;
300708µs my $value = shift ;
301705µs my $type = shift ;
302706µs my $validate = shift ;
303705µs my $output = shift;
304
305 #local $Carp::CarpLevel = $level ;
306 #print "PARSE $type $key $value $validate $sub\n" ;
307# if ( $type & Parse_store_ref)
308# {
309# #$value = $$value
310# # if ref ${ $value } ;
311#
312# $$output = $value ;
313# return 1;
314# }
315
316708µs $value = $$value ;
317
3187017µs if ($type & Parse_any)
319 {
32071µs $$output = $value ;
32176µs return 1;
322 }
323 elsif ($type & Parse_unsigned)
324 {
325142µs return $self->setError("Parameter '$key' must be an unsigned int, got 'undef'")
326 if $validate && ! defined $value ;
3271413µs76µs return $self->setError("Parameter '$key' must be an unsigned int, got '$value'")
# spent 6µs making 7 calls to CORE::match, avg 871ns/call
328 if $validate && $value !~ /^\d+$/;
329
330143µs $$output = defined $value ? $value : 0 ;
3311410µs return 1;
332 }
333 elsif ($type & Parse_signed)
334 {
335143µs return $self->setError("Parameter '$key' must be a signed int, got 'undef'")
336 if $validate && ! defined $value ;
3371420µs712µs return $self->setError("Parameter '$key' must be a signed int, got '$value'")
# spent 12µs making 7 calls to CORE::match, avg 2µs/call
338 if $validate && $value !~ /^-?\d+$/;
339
340144µs $$output = defined $value ? $value : 0 ;
3411420µs return 1 ;
342 }
343 elsif ($type & Parse_boolean)
344 {
345352µs return $self->setError("Parameter '$key' must be an int, got '$value'")
346 if $validate && defined $value && $value !~ /^\d*$/;
347356µs $$output = defined $value ? $value != 0 : 0 ;
3483527µs return 1;
349 }
350# elsif ($type & Parse_string)
351# {
352# $$output = defined $value ? $value : "" ;
353# return 1;
354# }
355
356 $$output = $value ;
357 return 1;
358}
359
- -
362sub Compress::Raw::Zlib::Parameters::parsed
363{
364 my $self = shift ;
365 my $name = shift ;
366
367 return $self->{Got}{lc $name}[OFF_PARSED] ;
368}
369
370sub Compress::Raw::Zlib::Parameters::value
371
# spent 49µs within Compress::Raw::Zlib::Parameters::value which was called 63 times, avg 778ns/call: # 14 times (9µs+0s) by Compress::Raw::Zlib::Inflate::new at line 476, avg 629ns/call # 7 times (12µs+0s) by Compress::Raw::Zlib::Inflate::new at line 460, avg 2µs/call # 7 times (5µs+0s) by Compress::Raw::Zlib::Inflate::new at line 465, avg 757ns/call # 7 times (5µs+0s) by Compress::Raw::Zlib::Inflate::new at line 467, avg 700ns/call # 7 times (5µs+0s) by Compress::Raw::Zlib::Inflate::new at line 466, avg 686ns/call # 7 times (4µs+0s) by Compress::Raw::Zlib::Inflate::new at line 468, avg 614ns/call # 7 times (4µs+0s) by Compress::Raw::Zlib::Inflate::new at line 472, avg 614ns/call # 7 times (4µs+0s) by Compress::Raw::Zlib::Inflate::new at line 469, avg 600ns/call
{
372635µs my $self = shift ;
373637µs my $name = shift ;
374
375635µs if (@_)
376 {
377 $self->{Got}{lc $name}[OFF_PARSED] = 1;
378 $self->{Got}{lc $name}[OFF_DEFAULT] = $_[0] ;
379 $self->{Got}{lc $name}[OFF_FIXED] = $_[0] ;
380 }
381
3826363µs return $self->{Got}{lc $name}[OFF_FIXED] ;
383}
384
385110µs535µsour $OPTIONS_deflate =
# spent 35µs making 5 calls to Compress::Raw::Zlib::AUTOLOAD, avg 7µs/call
386 {
387 'AppendOutput' => [1, 1, Parse_boolean, 0],
388 'CRC32' => [1, 1, Parse_boolean, 0],
389 'ADLER32' => [1, 1, Parse_boolean, 0],
390 'Bufsize' => [1, 1, Parse_unsigned, 4096],
391
392 'Level' => [1, 1, Parse_signed, Z_DEFAULT_COMPRESSION()],
393 'Method' => [1, 1, Parse_unsigned, Z_DEFLATED()],
394 'WindowBits' => [1, 1, Parse_signed, MAX_WBITS()],
395 'MemLevel' => [1, 1, Parse_unsigned, MAX_MEM_LEVEL()],
396 'Strategy' => [1, 1, Parse_unsigned, Z_DEFAULT_STRATEGY()],
397 'Dictionary' => [1, 1, Parse_any, ""],
398 };
399
400sub Compress::Raw::Zlib::Deflate::new
401{
402 my $pkg = shift ;
403 my ($got) = ParseParameters(0, $OPTIONS_deflate, @_);
404
405 croak "Compress::Raw::Zlib::Deflate::new: Bufsize must be >= 1, you specified " .
406 $got->value('Bufsize')
407 unless $got->value('Bufsize') >= 1;
408
409 my $flags = 0 ;
410 $flags |= FLAG_APPEND if $got->value('AppendOutput') ;
411 $flags |= FLAG_CRC if $got->value('CRC32') ;
412 $flags |= FLAG_ADLER if $got->value('ADLER32') ;
413
414 my $windowBits = $got->value('WindowBits');
415 $windowBits += MAX_WBITS()
416 if ($windowBits & MAX_WBITS()) == 0 ;
417
418 _deflateInit($flags,
419 $got->value('Level'),
420 $got->value('Method'),
421 $windowBits,
422 $got->value('MemLevel'),
423 $got->value('Strategy'),
424 $got->value('Bufsize'),
425 $got->value('Dictionary')) ;
426
427}
428
429sub Compress::Raw::Zlib::deflateStream::STORABLE_freeze
430{
431 my $type = ref shift;
432 croak "Cannot freeze $type object\n";
433}
434
435sub Compress::Raw::Zlib::deflateStream::STORABLE_thaw
436{
437 my $type = ref shift;
438 croak "Cannot thaw $type object\n";
439}
440
441
44212µs1300nsour $OPTIONS_inflate =
443 {
444 'AppendOutput' => [1, 1, Parse_boolean, 0],
445 'LimitOutput' => [1, 1, Parse_boolean, 0],
446 'CRC32' => [1, 1, Parse_boolean, 0],
447 'ADLER32' => [1, 1, Parse_boolean, 0],
448 'ConsumeInput' => [1, 1, Parse_boolean, 1],
449 'Bufsize' => [1, 1, Parse_unsigned, 4096],
450
451 'WindowBits' => [1, 1, Parse_signed, MAX_WBITS()],
452 'Dictionary' => [1, 1, Parse_any, ""],
453 } ;
454
455sub Compress::Raw::Zlib::Inflate::new
456
# spent 722µs (120+602) within Compress::Raw::Zlib::Inflate::new which was called 7 times, avg 103µs/call: # 7 times (120µs+602µs) by Archive::Zip::Member::rewindData at line 1225 of Archive/Zip/Member.pm, avg 103µs/call
{
45771µs my $pkg = shift ;
45878µs7510µs my ($got) = ParseParameters(0, $OPTIONS_inflate, @_);
# spent 510µs making 7 calls to Compress::Raw::Zlib::ParseParameters, avg 73µs/call
459
46076µs712µs croak "Compress::Raw::Zlib::Inflate::new: Bufsize must be >= 1, you specified " .
# spent 12µs making 7 calls to Compress::Raw::Zlib::Parameters::value, avg 2µs/call
461 $got->value('Bufsize')
462 unless $got->value('Bufsize') >= 1;
463
46471µs my $flags = 0 ;
46573µs75µs $flags |= FLAG_APPEND if $got->value('AppendOutput') ;
# spent 5µs making 7 calls to Compress::Raw::Zlib::Parameters::value, avg 757ns/call
46673µs75µs $flags |= FLAG_CRC if $got->value('CRC32') ;
# spent 5µs making 7 calls to Compress::Raw::Zlib::Parameters::value, avg 686ns/call
46774µs75µs $flags |= FLAG_ADLER if $got->value('ADLER32') ;
# spent 5µs making 7 calls to Compress::Raw::Zlib::Parameters::value, avg 700ns/call
46875µs74µs $flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ;
# spent 4µs making 7 calls to Compress::Raw::Zlib::Parameters::value, avg 614ns/call
46973µs74µs $flags |= FLAG_LIMIT_OUTPUT if $got->value('LimitOutput') ;
# spent 4µs making 7 calls to Compress::Raw::Zlib::Parameters::value, avg 600ns/call
470
471
47275µs74µs my $windowBits = $got->value('WindowBits');
# spent 4µs making 7 calls to Compress::Raw::Zlib::Parameters::value, avg 614ns/call
47376µs73µs $windowBits += MAX_WBITS()
# spent 3µs making 7 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:122], avg 486ns/call
474 if ($windowBits & MAX_WBITS()) == 0 ;
475
476780µs2148µs _inflateInit($flags, $windowBits, $got->value('Bufsize'),
# spent 40µs making 7 calls to Compress::Raw::Zlib::_inflateInit, avg 6µs/call # spent 9µs making 14 calls to Compress::Raw::Zlib::Parameters::value, avg 629ns/call
477 $got->value('Dictionary')) ;
478}
479
480sub Compress::Raw::Zlib::inflateStream::STORABLE_freeze
481{
482 my $type = ref shift;
483 croak "Cannot freeze $type object\n";
484}
485
486sub Compress::Raw::Zlib::inflateStream::STORABLE_thaw
487{
488 my $type = ref shift;
489 croak "Cannot thaw $type object\n";
490}
491
492sub Compress::Raw::Zlib::InflateScan::new
493{
494 my $pkg = shift ;
495 my ($got) = ParseParameters(0,
496 {
497 'CRC32' => [1, 1, Parse_boolean, 0],
498 'ADLER32' => [1, 1, Parse_boolean, 0],
499 'Bufsize' => [1, 1, Parse_unsigned, 4096],
500
501 'WindowBits' => [1, 1, Parse_signed, -MAX_WBITS()],
502 'Dictionary' => [1, 1, Parse_any, ""],
503 }, @_) ;
504
505
506 croak "Compress::Raw::Zlib::InflateScan::new: Bufsize must be >= 1, you specified " .
507 $got->value('Bufsize')
508 unless $got->value('Bufsize') >= 1;
509
510 my $flags = 0 ;
511 #$flags |= FLAG_APPEND if $got->value('AppendOutput') ;
512 $flags |= FLAG_CRC if $got->value('CRC32') ;
513 $flags |= FLAG_ADLER if $got->value('ADLER32') ;
514 #$flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ;
515
516 _inflateScanInit($flags, $got->value('WindowBits'), $got->value('Bufsize'),
517 '') ;
518}
519
520sub Compress::Raw::Zlib::inflateScanStream::createDeflateStream
521{
522 my $pkg = shift ;
523 my ($got) = ParseParameters(0,
524 {
525 'AppendOutput' => [1, 1, Parse_boolean, 0],
526 'CRC32' => [1, 1, Parse_boolean, 0],
527 'ADLER32' => [1, 1, Parse_boolean, 0],
528 'Bufsize' => [1, 1, Parse_unsigned, 4096],
529
530 'Level' => [1, 1, Parse_signed, Z_DEFAULT_COMPRESSION()],
531 'Method' => [1, 1, Parse_unsigned, Z_DEFLATED()],
532 'WindowBits' => [1, 1, Parse_signed, - MAX_WBITS()],
533 'MemLevel' => [1, 1, Parse_unsigned, MAX_MEM_LEVEL()],
534 'Strategy' => [1, 1, Parse_unsigned, Z_DEFAULT_STRATEGY()],
535 }, @_) ;
536
537 croak "Compress::Raw::Zlib::InflateScan::createDeflateStream: Bufsize must be >= 1, you specified " .
538 $got->value('Bufsize')
539 unless $got->value('Bufsize') >= 1;
540
541 my $flags = 0 ;
542 $flags |= FLAG_APPEND if $got->value('AppendOutput') ;
543 $flags |= FLAG_CRC if $got->value('CRC32') ;
544 $flags |= FLAG_ADLER if $got->value('ADLER32') ;
545
546 $pkg->_createDeflateStream($flags,
547 $got->value('Level'),
548 $got->value('Method'),
549 $got->value('WindowBits'),
550 $got->value('MemLevel'),
551 $got->value('Strategy'),
552 $got->value('Bufsize'),
553 ) ;
554
555}
556
557sub Compress::Raw::Zlib::inflateScanStream::inflate
558{
559 my $self = shift ;
560 my $buffer = $_[1];
561 my $eof = $_[2];
562
563 my $status = $self->scan(@_);
564
565 if ($status == Z_OK() && $_[2]) {
566 my $byte = ' ';
567
568 $status = $self->scan(\$byte, $_[1]) ;
569 }
570
571 return $status ;
572}
573
574sub Compress::Raw::Zlib::deflateStream::deflateParams
575{
576 my $self = shift ;
577 my ($got) = ParseParameters(0, {
578 'Level' => [1, 1, Parse_signed, undef],
579 'Strategy' => [1, 1, Parse_unsigned, undef],
580 'Bufsize' => [1, 1, Parse_unsigned, undef],
581 },
582 @_) ;
583
584 croak "Compress::Raw::Zlib::deflateParams needs Level and/or Strategy"
585 unless $got->parsed('Level') + $got->parsed('Strategy') +
586 $got->parsed('Bufsize');
587
588 croak "Compress::Raw::Zlib::Inflate::deflateParams: Bufsize must be >= 1, you specified " .
589 $got->value('Bufsize')
590 if $got->parsed('Bufsize') && $got->value('Bufsize') <= 1;
591
592 my $flags = 0;
593 $flags |= 1 if $got->parsed('Level') ;
594 $flags |= 2 if $got->parsed('Strategy') ;
595 $flags |= 4 if $got->parsed('Bufsize') ;
596
597 $self->_deflateParams($flags, $got->value('Level'),
598 $got->value('Strategy'), $got->value('Bufsize'));
599
600}
601
602
603113µs1;
604__END__
 
# spent 40µs within Compress::Raw::Zlib::_inflateInit which was called 7 times, avg 6µs/call: # 7 times (40µs+0s) by Compress::Raw::Zlib::Inflate::new at line 476, avg 6µs/call
sub Compress::Raw::Zlib::_inflateInit; # xsub
# spent 4µs within Compress::Raw::Zlib::constant which was called 7 times, avg 600ns/call: # 7 times (4µs+0s) by Compress::Raw::Zlib::AUTOLOAD at line 119, avg 600ns/call
sub Compress::Raw::Zlib::constant; # xsub
# spent 25µs within Compress::Raw::Zlib::inflateStream::DESTROY which was called 7 times, avg 4µs/call: # 7 times (25µs+0s) by Archive::Zip::Member::endRead at line 1255 of Archive/Zip/Member.pm, avg 4µs/call
sub Compress::Raw::Zlib::inflateStream::DESTROY; # xsub
# spent 12.1ms within Compress::Raw::Zlib::inflateStream::inflate which was called 7 times, avg 1.73ms/call: # 7 times (12.1ms+0s) by Archive::Zip::Member::_inflateChunk at line 1183 of Archive/Zip/Member.pm, avg 1.73ms/call
sub Compress::Raw::Zlib::inflateStream::inflate; # xsub