← 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/darwin-2level/Compress/Raw/Zlib.pm
StatementsExecuted 3669 statements in 16.8ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
6311127.8ms27.8msCompress::Raw::Zlib::inflateStream::::inflate Compress::Raw::Zlib::inflateStream::inflate (xsub)
25611353.35ms3.35msCompress::Raw::Zlib::::__ANON__[:114] Compress::Raw::Zlib::__ANON__[:114]
3111.10ms1.10msCompress::Raw::Zlib::::_inflateInit Compress::Raw::Zlib::_inflateInit (xsub)
311576µs855µsCompress::Raw::Zlib::Parameters::::parse Compress::Raw::Zlib::Parameters::parse
3921223µs268µsCompress::Raw::Zlib::Parameters::::_checkType Compress::Raw::Zlib::Parameters::_checkType
311207µs2.38msCompress::Raw::Zlib::Inflate::::new Compress::Raw::Zlib::Inflate::new
943172µs248µsCompress::Raw::Zlib::::AUTOLOAD Compress::Raw::Zlib::AUTOLOAD
311104µs979µsCompress::Raw::Zlib::::ParseParameters Compress::Raw::Zlib::ParseParameters
278191µs91µsCompress::Raw::Zlib::Parameters::::value Compress::Raw::Zlib::Parameters::value
242162µs62µsCompress::Raw::Zlib::::CORE:subst Compress::Raw::Zlib::CORE:subst (opcode)
152145µs45µsCompress::Raw::Zlib::::CORE:match Compress::Raw::Zlib::CORE:match (opcode)
11127µs74µsCompress::Raw::Zlib::::BEGIN@6 Compress::Raw::Zlib::BEGIN@6
91125µs25µsCompress::Raw::Zlib::::constant Compress::Raw::Zlib::constant (xsub)
31120µs20µsCompress::Raw::Zlib::Parameters::::new Compress::Raw::Zlib::Parameters::new
32218µs18µsCompress::Raw::Zlib::inflateStream::::DESTROY Compress::Raw::Zlib::inflateStream::DESTROY (xsub)
11113µs48µsCompress::Raw::Zlib::::BEGIN@148 Compress::Raw::Zlib::BEGIN@148
11112µs16µsCompress::Raw::Zlib::::BEGIN@10 Compress::Raw::Zlib::BEGIN@10
11112µs52µsCompress::Raw::Zlib::::BEGIN@118 Compress::Raw::Zlib::BEGIN@118
11111µs28µsCompress::Raw::Zlib::::BEGIN@113 Compress::Raw::Zlib::BEGIN@113
11110µs48µsCompress::Raw::Zlib::::BEGIN@106 Compress::Raw::Zlib::BEGIN@106
11110µs14µsCompress::Raw::Zlib::::BEGIN@8 Compress::Raw::Zlib::BEGIN@8
1119µs59µsCompress::Raw::Zlib::::BEGIN@105 Compress::Raw::Zlib::BEGIN@105
1119µs43µsCompress::Raw::Zlib::::BEGIN@120 Compress::Raw::Zlib::BEGIN@120
1119µs44µsCompress::Raw::Zlib::::BEGIN@121 Compress::Raw::Zlib::BEGIN@121
1119µs44µsCompress::Raw::Zlib::::BEGIN@149 Compress::Raw::Zlib::BEGIN@149
1119µs19µsCompress::Raw::Zlib::::BEGIN@9 Compress::Raw::Zlib::BEGIN@9
1118µs45µsCompress::Raw::Zlib::::BEGIN@122 Compress::Raw::Zlib::BEGIN@122
1118µs43µsCompress::Raw::Zlib::::BEGIN@136 Compress::Raw::Zlib::BEGIN@136
1118µs40µsCompress::Raw::Zlib::::BEGIN@138 Compress::Raw::Zlib::BEGIN@138
1118µs43µsCompress::Raw::Zlib::::BEGIN@139 Compress::Raw::Zlib::BEGIN@139
1118µs40µsCompress::Raw::Zlib::::BEGIN@145 Compress::Raw::Zlib::BEGIN@145
1117µs44µsCompress::Raw::Zlib::::BEGIN@119 Compress::Raw::Zlib::BEGIN@119
1117µs38µsCompress::Raw::Zlib::::BEGIN@137 Compress::Raw::Zlib::BEGIN@137
1117µs39µsCompress::Raw::Zlib::::BEGIN@146 Compress::Raw::Zlib::BEGIN@146
1117µs40µsCompress::Raw::Zlib::::BEGIN@150 Compress::Raw::Zlib::BEGIN@150
1116µs37µsCompress::Raw::Zlib::::BEGIN@147 Compress::Raw::Zlib::BEGIN@147
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
4115µsrequire 5.006 ;
511µsrequire Exporter;
6240µs2121µs
# spent 74µs (27+47) within Compress::Raw::Zlib::BEGIN@6 which was called: # once (27µs+47µs) by Compress::Zlib::BEGIN@11 at line 6
use Carp ;
# spent 74µs making 1 call to Compress::Raw::Zlib::BEGIN@6 # spent 47µs making 1 call to Exporter::import
7
8230µs218µs
# spent 14µs (10+4) within Compress::Raw::Zlib::BEGIN@8 which was called: # once (10µs+4µs) by Compress::Zlib::BEGIN@11 at line 8
use strict ;
# spent 14µs making 1 call to Compress::Raw::Zlib::BEGIN@8 # spent 4µs making 1 call to strict::import
9237µs229µs
# spent 19µs (9+10) within Compress::Raw::Zlib::BEGIN@9 which was called: # once (9µs+10µs) by Compress::Zlib::BEGIN@11 at line 9
use warnings ;
# spent 19µs making 1 call to Compress::Raw::Zlib::BEGIN@9 # spent 10µs making 1 call to warnings::import
102239µs220µs
# spent 16µs (12+4) within Compress::Raw::Zlib::BEGIN@10 which was called: # once (12µs+4µs) by Compress::Zlib::BEGIN@11 at line 10
use bytes ;
# spent 16µs making 1 call to Compress::Raw::Zlib::BEGIN@10 # spent 4µs making 1 call to bytes::import
11our ($VERSION, $XS_VERSION, @ISA, @EXPORT, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD, %DEFLATE_CONSTANTS, @DEFLATE_CONSTANTS);
12
1311µs$VERSION = '2.074';
1410s$XS_VERSION = $VERSION;
15117µs$VERSION = eval $VERSION;
# spent 4µs executing statements in string eval
16
1719µs@ISA = qw(Exporter);
1818µ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
52112µ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.
57115µ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 WANT_GZIP
100 WANT_GZIP_OR_ZLIB
101);
102
10313µspush @EXPORT, qw(crc32 adler32 DEF_WBITS);
104
105236µs2109µs
# spent 59µs (9+50) within Compress::Raw::Zlib::BEGIN@105 which was called: # once (9µs+50µs) by Compress::Zlib::BEGIN@11 at line 105
use constant WANT_GZIP => 16;
# spent 59µs making 1 call to Compress::Raw::Zlib::BEGIN@105 # spent 50µs making 1 call to constant::import
106292µs286µs
# spent 48µs (10+38) within Compress::Raw::Zlib::BEGIN@106 which was called: # once (10µs+38µs) by Compress::Zlib::BEGIN@11 at line 106
use constant WANT_GZIP_OR_ZLIB => 32;
# spent 48µs making 1 call to Compress::Raw::Zlib::BEGIN@106 # spent 38µs making 1 call to constant::import
107
108
# spent 248µs (172+76) within Compress::Raw::Zlib::AUTOLOAD which was called 9 times, avg 28µs/call: # 5 times (79µs+37µs) by Compress::Zlib::BEGIN@11 at line 377, avg 23µs/call # 2 times (42µs+18µs) by IO::Uncompress::Adapter::Inflate::uncompr at line 66 of IO/Uncompress/Adapter/Inflate.pm, avg 30µs/call # once (28µs+12µs) by Compress::Zlib::_set_gzerr at line 72 of Compress/Zlib.pm # once (23µs+9µs) by IO::Uncompress::Adapter::Inflate::mkUncompObject at line 42 of IO/Uncompress/Adapter/Inflate.pm
sub AUTOLOAD {
10993µs my($constname);
110984µs951µs ($constname = $AUTOLOAD) =~ s/.*:://;
# spent 51µs making 9 calls to Compress::Raw::Zlib::CORE:subst, avg 6µs/call
111954µs925µs my ($error, $val) = constant($constname);
# spent 25µs making 9 calls to Compress::Raw::Zlib::constant, avg 3µs/call
11291µs Carp::croak $error if $error;
113291µs245µs
# spent 28µs (11+17) within Compress::Raw::Zlib::BEGIN@113 which was called: # once (11µs+17µs) by Compress::Zlib::BEGIN@11 at line 113
no strict 'refs';
# spent 28µs making 1 call to Compress::Raw::Zlib::BEGIN@113 # spent 17µs making 1 call to strict::unimport
11425708.01ms
# spent 3.35ms within Compress::Raw::Zlib::__ANON__[/usr/local/perls/perl-5.26.1/lib/5.26.1/darwin-2level/Compress/Raw/Zlib.pm:114] which was called 2561 times, avg 1µs/call: # 1889 times (2.60ms+0s) by IO::Uncompress::Adapter::Inflate::uncompr at line 66 of IO/Uncompress/Adapter/Inflate.pm, avg 1µs/call # 631 times (616µs+0s) by IO::Uncompress::Adapter::Inflate::uncompr at line 72 of IO/Uncompress/Adapter/Inflate.pm, avg 976ns/call # 9 times (11µs+0s) by Compress::Zlib::BEGIN@11 or Compress::Zlib::_set_gzerr or IO::Uncompress::Adapter::Inflate::mkUncompObject or IO::Uncompress::Adapter::Inflate::uncompr at line 115, avg 1µs/call # 9 times (10µs+0s) by Compress::Zlib::_set_gzerr at line 72 of Compress/Zlib.pm, avg 1µs/call # 6 times (60µs+0s) by Compress::Zlib::gzopen at line 112 of Compress/Zlib.pm, avg 10µs/call # 3 times (21µs+0s) by IO::Uncompress::Adapter::Inflate::mkUncompObject at line 34 of IO/Uncompress/Adapter/Inflate.pm, avg 7µs/call # 3 times (6µs+0s) by Compress::Raw::Zlib::Inflate::new at line 465, avg 2µs/call # 2 times (14µs+0s) by IO::Uncompress::Adapter::Inflate::mkUncompObject at line 42 of IO/Uncompress/Adapter/Inflate.pm, avg 7µs/call # 2 times (7µs+0s) by IO::Compress::Gzip::BEGIN@11 at line 121 of IO/Compress/RawDeflate.pm, avg 4µs/call # 2 times (3µs+0s) by CPAN::Tarzip::gtest at line 152 of CPAN/Tarzip.pm, avg 2µs/call # 2 times (3µs+0s) by IO::Uncompress::Adapter::Inflate::uncompr at line 74 of IO/Uncompress/Adapter/Inflate.pm, avg 2µs/call # 2 times (3µs+0s) by IO::Uncompress::Adapter::Inflate::uncompr at line 73 of IO/Uncompress/Adapter/Inflate.pm, avg 2µs/call # once (1µs+0s) by Compress::Zlib::BEGIN@11 at line 434
*{$AUTOLOAD} = sub { $val };
115952µs911µs goto &{$AUTOLOAD};
# spent 11µs making 9 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:114], avg 1µs/call
116}
117
118232µs292µs
# spent 52µs (12+40) within Compress::Raw::Zlib::BEGIN@118 which was called: # once (12µs+40µs) by Compress::Zlib::BEGIN@11 at line 118
use constant FLAG_APPEND => 1 ;
# spent 52µs making 1 call to Compress::Raw::Zlib::BEGIN@118 # spent 40µs making 1 call to constant::import
119230µs281µs
# spent 44µs (7+37) within Compress::Raw::Zlib::BEGIN@119 which was called: # once (7µs+37µs) by Compress::Zlib::BEGIN@11 at line 119
use constant FLAG_CRC => 2 ;
# spent 44µs making 1 call to Compress::Raw::Zlib::BEGIN@119 # spent 37µs making 1 call to constant::import
120229µs277µs
# spent 43µs (9+34) within Compress::Raw::Zlib::BEGIN@120 which was called: # once (9µs+34µs) by Compress::Zlib::BEGIN@11 at line 120
use constant FLAG_ADLER => 4 ;
# spent 43µs making 1 call to Compress::Raw::Zlib::BEGIN@120 # spent 34µs making 1 call to constant::import
121231µs279µs
# spent 44µs (9+35) within Compress::Raw::Zlib::BEGIN@121 which was called: # once (9µs+35µs) by Compress::Zlib::BEGIN@11 at line 121
use constant FLAG_CONSUME_INPUT => 8 ;
# spent 44µs making 1 call to Compress::Raw::Zlib::BEGIN@121 # spent 35µs making 1 call to constant::import
122285µs282µs
# spent 45µs (8+37) within Compress::Raw::Zlib::BEGIN@122 which was called: # once (8µs+37µs) by Compress::Zlib::BEGIN@11 at line 122
use constant FLAG_LIMIT_OUTPUT => 16 ;
# spent 45µs making 1 call to Compress::Raw::Zlib::BEGIN@122 # spent 37µs making 1 call to constant::import
123
124eval {
12511µs require XSLoader;
12612.12ms12.10ms XSLoader::load('Compress::Raw::Zlib', $XS_VERSION);
# spent 2.10ms making 1 call to XSLoader::load
12711µs 1;
128}
12911µsor do {
130 require DynaLoader;
131 local @ISA = qw(DynaLoader);
132 bootstrap Compress::Raw::Zlib $XS_VERSION ;
133};
134
135
136229µs278µs
# spent 43µs (8+35) within Compress::Raw::Zlib::BEGIN@136 which was called: # once (8µs+35µs) by Compress::Zlib::BEGIN@11 at line 136
use constant Parse_any => 0x01;
# spent 43µs making 1 call to Compress::Raw::Zlib::BEGIN@136 # spent 35µs making 1 call to constant::import
137229µs269µs
# spent 38µs (7+31) within Compress::Raw::Zlib::BEGIN@137 which was called: # once (7µs+31µs) by Compress::Zlib::BEGIN@11 at line 137
use constant Parse_unsigned => 0x02;
# spent 38µs making 1 call to Compress::Raw::Zlib::BEGIN@137 # spent 31µs making 1 call to constant::import
138229µs272µs
# spent 40µs (8+32) within Compress::Raw::Zlib::BEGIN@138 which was called: # once (8µs+32µs) by Compress::Zlib::BEGIN@11 at line 138
use constant Parse_signed => 0x04;
# spent 40µs making 1 call to Compress::Raw::Zlib::BEGIN@138 # spent 32µs making 1 call to constant::import
139233µs278µs
# spent 43µs (8+35) within Compress::Raw::Zlib::BEGIN@139 which was called: # once (8µs+35µs) by Compress::Zlib::BEGIN@11 at line 139
use constant Parse_boolean => 0x08;
# spent 43µs making 1 call to Compress::Raw::Zlib::BEGIN@139 # spent 35µs making 1 call to constant::import
140#use constant Parse_string => 0x10;
141#use constant Parse_custom => 0x12;
142
143#use constant Parse_store_ref => 0x100 ;
144
145229µs272µs
# spent 40µs (8+32) within Compress::Raw::Zlib::BEGIN@145 which was called: # once (8µs+32µs) by Compress::Zlib::BEGIN@11 at line 145
use constant OFF_PARSED => 0 ;
# spent 40µs making 1 call to Compress::Raw::Zlib::BEGIN@145 # spent 32µs making 1 call to constant::import
146229µs271µs
# spent 39µs (7+32) within Compress::Raw::Zlib::BEGIN@146 which was called: # once (7µs+32µs) by Compress::Zlib::BEGIN@11 at line 146
use constant OFF_TYPE => 1 ;
# spent 39µs making 1 call to Compress::Raw::Zlib::BEGIN@146 # spent 32µs making 1 call to constant::import
147234µs268µs
# spent 37µs (6+31) within Compress::Raw::Zlib::BEGIN@147 which was called: # once (6µs+31µs) by Compress::Zlib::BEGIN@11 at line 147
use constant OFF_DEFAULT => 2 ;
# spent 37µs making 1 call to Compress::Raw::Zlib::BEGIN@147 # spent 31µs making 1 call to constant::import
148230µs283µs
# spent 48µs (13+35) within Compress::Raw::Zlib::BEGIN@148 which was called: # once (13µs+35µs) by Compress::Zlib::BEGIN@11 at line 148
use constant OFF_FIXED => 3 ;
# spent 48µs making 1 call to Compress::Raw::Zlib::BEGIN@148 # spent 35µs making 1 call to constant::import
149230µs279µs
# spent 44µs (9+35) within Compress::Raw::Zlib::BEGIN@149 which was called: # once (9µs+35µs) by Compress::Zlib::BEGIN@11 at line 149
use constant OFF_FIRST_ONLY => 4 ;
# spent 44µs making 1 call to Compress::Raw::Zlib::BEGIN@149 # spent 35µs making 1 call to constant::import
15022.92ms273µs
# spent 40µs (7+33) within Compress::Raw::Zlib::BEGIN@150 which was called: # once (7µs+33µs) by Compress::Zlib::BEGIN@11 at line 150
use constant OFF_STICKY => 5 ;
# spent 40µs making 1 call to Compress::Raw::Zlib::BEGIN@150 # spent 33µs making 1 call to constant::import
151
- -
154sub ParseParameters
155
# spent 979µs (104+875) within Compress::Raw::Zlib::ParseParameters which was called 3 times, avg 326µs/call: # 3 times (104µs+875µs) by Compress::Raw::Zlib::Inflate::new at line 450, avg 326µs/call
{
15632µs my $level = shift || 0 ;
157
158329µs my $sub = (caller($level + 1))[3] ;
159 #local $Carp::CarpLevel = 1 ;
160342µs320µs my $p = new Compress::Raw::Zlib::Parameters() ;
# spent 20µs making 3 calls to Compress::Raw::Zlib::Parameters::new, avg 7µs/call
161329µs3855µs $p->parse(@_)
# spent 855µs making 3 calls to Compress::Raw::Zlib::Parameters::parse, avg 285µs/call
162 or croak "$sub: $p->{Error}" ;
163
164310µs return $p;
165}
166
167
168sub Compress::Raw::Zlib::Parameters::new
169
# spent 20µs within Compress::Raw::Zlib::Parameters::new which was called 3 times, avg 7µs/call: # 3 times (20µs+0s) by Compress::Raw::Zlib::ParseParameters at line 160, avg 7µs/call
{
17033µs my $class = shift ;
171
172310µs my $obj = { Error => '',
173 Got => {},
174 } ;
175
176 #return bless $obj, ref($class) || $class || __PACKAGE__ ;
177314µs return bless $obj, 'Compress::Raw::Zlib::Parameters' ;
178}
179
180sub Compress::Raw::Zlib::Parameters::setError
181{
182 my $self = shift ;
183 my $error = shift ;
184 my $retval = @_ ? shift : undef ;
185
186 $self->{Error} = $error ;
187 return $retval;
188}
189
190#sub getError
191#{
192# my $self = shift ;
193# return $self->{Error} ;
194#}
195
196sub Compress::Raw::Zlib::Parameters::parse
197
# spent 855µs (576+279) within Compress::Raw::Zlib::Parameters::parse which was called 3 times, avg 285µs/call: # 3 times (576µs+279µs) by Compress::Raw::Zlib::ParseParameters at line 161, avg 285µs/call
{
19831µs my $self = shift ;
199
20031µs my $default = shift ;
201
202317µs my $got = $self->{Got} ;
20335µs my $firstTime = keys %{ $got } == 0 ;
204
20530s my (@Bad) ;
206314µs my @entered = () ;
207
208 # Allow the options to be passed as a hash reference or
209 # as the complete hash.
210336µs if (@_ == 0) {
211 @entered = () ;
212 }
213 elsif (@_ == 1) {
214 my $href = $_[0] ;
215 return $self->setError("Expected even number of parameters, got 1")
216 if ! defined $href or ! ref $href or ref $href ne "HASH" ;
217
218 foreach my $key (keys %$href) {
219 push @entered, $key ;
220 push @entered, \$href->{$key} ;
221 }
222 }
223 else {
22431µs my $count = @_;
22532µs return $self->setError("Expected even number of parameters, got $count")
226 if $count % 2 != 0 ;
227
228310µs for my $i (0.. $count / 2 - 1) {
2291512µs push @entered, $_[2* $i] ;
230158µs push @entered, \$_[2* $i+1] ;
231 }
232 }
233
234
235347µs while (my ($key, $v) = each %$default)
236 {
2372416µs croak "need 4 params [@$v]"
238 if @$v != 4 ;
239
2402418µs my ($first_only, $sticky, $type, $value) = @$v ;
241242µs my $x ;
2422445µs24119µs $self->_checkType($key, \$value, $type, 0, \$x)
# spent 119µs making 24 calls to Compress::Raw::Zlib::Parameters::_checkType, avg 5µs/call
243 or return undef ;
244
2452416µs $key = lc $key;
246
2472455µs if ($firstTime || ! $sticky) {
248 $got->{$key} = [0, $type, $value, $x, $first_only, $sticky] ;
249 }
250
2512418µs $got->{$key}[OFF_PARSED] = 0 ;
252 }
253
25436µs for my $i (0.. @entered / 2 - 1) {
2551511µs my $key = $entered[2* $i] ;
256153µs my $value = $entered[2* $i+1] ;
257
258 #print "Key [$key] Value [$value]" ;
259 #print defined $$value ? "[$$value]\n" : "[undef]\n";
260
2611559µs1511µs $key =~ s/^-// ;
# spent 11µs making 15 calls to Compress::Raw::Zlib::CORE:subst, avg 733ns/call
2621510µs my $canonkey = lc $key;
263
2641514µs if ($got->{$canonkey} && ($firstTime ||
265 ! $got->{$canonkey}[OFF_FIRST_ONLY] ))
266 {
267158µs my $type = $got->{$canonkey}[OFF_TYPE] ;
268153µs my $s ;
2691529µs15149µs $self->_checkType($key, $value, $type, 1, \$s)
# spent 149µs making 15 calls to Compress::Raw::Zlib::Parameters::_checkType, avg 10µs/call
270 or return undef ;
271 #$value = $$value unless $type & Parse_store_ref ;
272154µs $value = $$value ;
2731531µs $got->{$canonkey} = [1, $type, $value, $s] ;
274 }
275 else
276 { push (@Bad, $key) }
277 }
278
27931µs if (@Bad) {
280 my ($bad) = join(", ", @Bad) ;
281 return $self->setError("unknown key value(s) @Bad") ;
282 }
283
284325µs return 1;
285}
286
287sub Compress::Raw::Zlib::Parameters::_checkType
288
# spent 268µs (223+45) within Compress::Raw::Zlib::Parameters::_checkType which was called 39 times, avg 7µs/call: # 24 times (119µs+0s) by Compress::Raw::Zlib::Parameters::parse at line 242, avg 5µs/call # 15 times (104µs+45µs) by Compress::Raw::Zlib::Parameters::parse at line 269, avg 10µs/call
{
2893917µs my $self = shift ;
290
2913910µs my $key = shift ;
292397µs my $value = shift ;
2933917µs my $type = shift ;
294394µs my $validate = shift ;
295397µs my $output = shift;
296
297 #local $Carp::CarpLevel = $level ;
298 #print "PARSE $type $key $value $validate $sub\n" ;
299# if ( $type & Parse_store_ref)
300# {
301# #$value = $$value
302# # if ref ${ $value } ;
303#
304# $$output = $value ;
305# return 1;
306# }
307
308398µs $value = $$value ;
309
3103918µs if ($type & Parse_any)
311 {
31231µs $$output = $value ;
313318µs return 1;
314 }
315 elsif ($type & Parse_unsigned)
316 {
31731µs return $self->setError("Parameter '$key' must be an unsigned int, got 'undef'")
318 if $validate && ! defined $value ;
31931µs return $self->setError("Parameter '$key' must be an unsigned int, got '$value'")
320 if $validate && $value !~ /^\d+$/;
321
32232µs $$output = defined $value ? $value : 0 ;
32339µs return 1;
324 }
325 elsif ($type & Parse_signed)
326 {
32761µs return $self->setError("Parameter '$key' must be a signed int, got 'undef'")
328 if $validate && ! defined $value ;
329619µs39µs return $self->setError("Parameter '$key' must be a signed int, got '$value'")
# spent 9µs making 3 calls to Compress::Raw::Zlib::CORE:match, avg 3µs/call
330 if $validate && $value !~ /^-?\d+$/;
331
33263µs $$output = defined $value ? $value : 0 ;
333615µs return 1 ;
334 }
335 elsif ($type & Parse_boolean)
336 {
3372777µs1236µs return $self->setError("Parameter '$key' must be an int, got '$value'")
# spent 36µs making 12 calls to Compress::Raw::Zlib::CORE:match, avg 3µs/call
338 if $validate && defined $value && $value !~ /^\d*$/;
339279µs $$output = defined $value ? $value != 0 : 0 ;
3402768µs return 1;
341 }
342# elsif ($type & Parse_string)
343# {
344# $$output = defined $value ? $value : "" ;
345# return 1;
346# }
347
348 $$output = $value ;
349 return 1;
350}
351
- -
354sub Compress::Raw::Zlib::Parameters::parsed
355{
356 my $self = shift ;
357 my $name = shift ;
358
359 return $self->{Got}{lc $name}[OFF_PARSED] ;
360}
361
362sub Compress::Raw::Zlib::Parameters::value
363
# spent 91µs within Compress::Raw::Zlib::Parameters::value which was called 27 times, avg 3µs/call: # 6 times (18µs+0s) by Compress::Raw::Zlib::Inflate::new at line 468, avg 3µs/call # 3 times (21µs+0s) by Compress::Raw::Zlib::Inflate::new at line 452, avg 7µs/call # 3 times (11µs+0s) by Compress::Raw::Zlib::Inflate::new at line 457, avg 4µs/call # 3 times (10µs+0s) by Compress::Raw::Zlib::Inflate::new at line 459, avg 3µs/call # 3 times (10µs+0s) by Compress::Raw::Zlib::Inflate::new at line 460, avg 3µs/call # 3 times (8µs+0s) by Compress::Raw::Zlib::Inflate::new at line 464, avg 3µs/call # 3 times (7µs+0s) by Compress::Raw::Zlib::Inflate::new at line 461, avg 2µs/call # 3 times (6µs+0s) by Compress::Raw::Zlib::Inflate::new at line 458, avg 2µs/call
{
3642710µs my $self = shift ;
365275µs my $name = shift ;
366
3672710µs if (@_)
368 {
369 $self->{Got}{lc $name}[OFF_PARSED] = 1;
370 $self->{Got}{lc $name}[OFF_DEFAULT] = $_[0] ;
371 $self->{Got}{lc $name}[OFF_FIXED] = $_[0] ;
372 }
373
3742793µs return $self->{Got}{lc $name}[OFF_FIXED] ;
375}
376
377140µs5116µsour $OPTIONS_deflate =
# spent 116µs making 5 calls to Compress::Raw::Zlib::AUTOLOAD, avg 23µs/call
378 {
379 'AppendOutput' => [1, 1, Parse_boolean, 0],
380 'CRC32' => [1, 1, Parse_boolean, 0],
381 'ADLER32' => [1, 1, Parse_boolean, 0],
382 'Bufsize' => [1, 1, Parse_unsigned, 4096],
383
384 'Level' => [1, 1, Parse_signed, Z_DEFAULT_COMPRESSION()],
385 'Method' => [1, 1, Parse_unsigned, Z_DEFLATED()],
386 'WindowBits' => [1, 1, Parse_signed, MAX_WBITS()],
387 'MemLevel' => [1, 1, Parse_unsigned, MAX_MEM_LEVEL()],
388 'Strategy' => [1, 1, Parse_unsigned, Z_DEFAULT_STRATEGY()],
389 'Dictionary' => [1, 1, Parse_any, ""],
390 };
391
392sub Compress::Raw::Zlib::Deflate::new
393{
394 my $pkg = shift ;
395 my ($got) = ParseParameters(0, $OPTIONS_deflate, @_);
396
397 croak "Compress::Raw::Zlib::Deflate::new: Bufsize must be >= 1, you specified " .
398 $got->value('Bufsize')
399 unless $got->value('Bufsize') >= 1;
400
401 my $flags = 0 ;
402 $flags |= FLAG_APPEND if $got->value('AppendOutput') ;
403 $flags |= FLAG_CRC if $got->value('CRC32') ;
404 $flags |= FLAG_ADLER if $got->value('ADLER32') ;
405
406 my $windowBits = $got->value('WindowBits');
407 $windowBits += MAX_WBITS()
408 if ($windowBits & MAX_WBITS()) == 0 ;
409
410 _deflateInit($flags,
411 $got->value('Level'),
412 $got->value('Method'),
413 $windowBits,
414 $got->value('MemLevel'),
415 $got->value('Strategy'),
416 $got->value('Bufsize'),
417 $got->value('Dictionary')) ;
418
419}
420
421sub Compress::Raw::Zlib::deflateStream::STORABLE_freeze
422{
423 my $type = ref shift;
424 croak "Cannot freeze $type object\n";
425}
426
427sub Compress::Raw::Zlib::deflateStream::STORABLE_thaw
428{
429 my $type = ref shift;
430 croak "Cannot thaw $type object\n";
431}
432
433
43418µs11µsour $OPTIONS_inflate =
435 {
436 'AppendOutput' => [1, 1, Parse_boolean, 0],
437 'LimitOutput' => [1, 1, Parse_boolean, 0],
438 'CRC32' => [1, 1, Parse_boolean, 0],
439 'ADLER32' => [1, 1, Parse_boolean, 0],
440 'ConsumeInput' => [1, 1, Parse_boolean, 1],
441 'Bufsize' => [1, 1, Parse_unsigned, 4096],
442
443 'WindowBits' => [1, 1, Parse_signed, MAX_WBITS()],
444 'Dictionary' => [1, 1, Parse_any, ""],
445 } ;
446
447sub Compress::Raw::Zlib::Inflate::new
448
# spent 2.38ms (207µs+2.17) within Compress::Raw::Zlib::Inflate::new which was called 3 times, avg 793µs/call: # 3 times (207µs+2.17ms) by IO::Uncompress::Adapter::Inflate::mkUncompObject at line 34 of IO/Uncompress/Adapter/Inflate.pm, avg 793µs/call
{
44935µs my $pkg = shift ;
450315µs3979µs my ($got) = ParseParameters(0, $OPTIONS_inflate, @_);
# spent 979µs making 3 calls to Compress::Raw::Zlib::ParseParameters, avg 326µs/call
451
452311µs321µs croak "Compress::Raw::Zlib::Inflate::new: Bufsize must be >= 1, you specified " .
# spent 21µs making 3 calls to Compress::Raw::Zlib::Parameters::value, avg 7µs/call
453 $got->value('Bufsize')
454 unless $got->value('Bufsize') >= 1;
455
45632µs my $flags = 0 ;
45738µs311µs $flags |= FLAG_APPEND if $got->value('AppendOutput') ;
# spent 11µs making 3 calls to Compress::Raw::Zlib::Parameters::value, avg 4µs/call
45836µs36µs $flags |= FLAG_CRC if $got->value('CRC32') ;
# spent 6µs making 3 calls to Compress::Raw::Zlib::Parameters::value, avg 2µs/call
45936µs310µs $flags |= FLAG_ADLER if $got->value('ADLER32') ;
# spent 10µs making 3 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call
46039µs310µs $flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ;
# spent 10µs making 3 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call
46135µs37µs $flags |= FLAG_LIMIT_OUTPUT if $got->value('LimitOutput') ;
# spent 7µs making 3 calls to Compress::Raw::Zlib::Parameters::value, avg 2µs/call
462
463
46437µs38µs my $windowBits = $got->value('WindowBits');
# spent 8µs making 3 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call
46538µs36µs $windowBits += MAX_WBITS()
# spent 6µs making 3 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:114], avg 2µs/call
466 if ($windowBits & MAX_WBITS()) == 0 ;
467
46831.19ms91.12ms _inflateInit($flags, $windowBits, $got->value('Bufsize'),
# spent 1.10ms making 3 calls to Compress::Raw::Zlib::_inflateInit, avg 366µs/call # spent 18µs making 6 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call
469 $got->value('Dictionary')) ;
470}
471
472sub Compress::Raw::Zlib::inflateStream::STORABLE_freeze
473{
474 my $type = ref shift;
475 croak "Cannot freeze $type object\n";
476}
477
478sub Compress::Raw::Zlib::inflateStream::STORABLE_thaw
479{
480 my $type = ref shift;
481 croak "Cannot thaw $type object\n";
482}
483
484sub Compress::Raw::Zlib::InflateScan::new
485{
486 my $pkg = shift ;
487 my ($got) = ParseParameters(0,
488 {
489 'CRC32' => [1, 1, Parse_boolean, 0],
490 'ADLER32' => [1, 1, Parse_boolean, 0],
491 'Bufsize' => [1, 1, Parse_unsigned, 4096],
492
493 'WindowBits' => [1, 1, Parse_signed, -MAX_WBITS()],
494 'Dictionary' => [1, 1, Parse_any, ""],
495 }, @_) ;
496
497
498 croak "Compress::Raw::Zlib::InflateScan::new: Bufsize must be >= 1, you specified " .
499 $got->value('Bufsize')
500 unless $got->value('Bufsize') >= 1;
501
502 my $flags = 0 ;
503 #$flags |= FLAG_APPEND if $got->value('AppendOutput') ;
504 $flags |= FLAG_CRC if $got->value('CRC32') ;
505 $flags |= FLAG_ADLER if $got->value('ADLER32') ;
506 #$flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ;
507
508 _inflateScanInit($flags, $got->value('WindowBits'), $got->value('Bufsize'),
509 '') ;
510}
511
512sub Compress::Raw::Zlib::inflateScanStream::createDeflateStream
513{
514 my $pkg = shift ;
515 my ($got) = ParseParameters(0,
516 {
517 'AppendOutput' => [1, 1, Parse_boolean, 0],
518 'CRC32' => [1, 1, Parse_boolean, 0],
519 'ADLER32' => [1, 1, Parse_boolean, 0],
520 'Bufsize' => [1, 1, Parse_unsigned, 4096],
521
522 'Level' => [1, 1, Parse_signed, Z_DEFAULT_COMPRESSION()],
523 'Method' => [1, 1, Parse_unsigned, Z_DEFLATED()],
524 'WindowBits' => [1, 1, Parse_signed, - MAX_WBITS()],
525 'MemLevel' => [1, 1, Parse_unsigned, MAX_MEM_LEVEL()],
526 'Strategy' => [1, 1, Parse_unsigned, Z_DEFAULT_STRATEGY()],
527 }, @_) ;
528
529 croak "Compress::Raw::Zlib::InflateScan::createDeflateStream: Bufsize must be >= 1, you specified " .
530 $got->value('Bufsize')
531 unless $got->value('Bufsize') >= 1;
532
533 my $flags = 0 ;
534 $flags |= FLAG_APPEND if $got->value('AppendOutput') ;
535 $flags |= FLAG_CRC if $got->value('CRC32') ;
536 $flags |= FLAG_ADLER if $got->value('ADLER32') ;
537
538 $pkg->_createDeflateStream($flags,
539 $got->value('Level'),
540 $got->value('Method'),
541 $got->value('WindowBits'),
542 $got->value('MemLevel'),
543 $got->value('Strategy'),
544 $got->value('Bufsize'),
545 ) ;
546
547}
548
549sub Compress::Raw::Zlib::inflateScanStream::inflate
550{
551 my $self = shift ;
552 my $buffer = $_[1];
553 my $eof = $_[2];
554
555 my $status = $self->scan(@_);
556
557 if ($status == Z_OK() && $_[2]) {
558 my $byte = ' ';
559
560 $status = $self->scan(\$byte, $_[1]) ;
561 }
562
563 return $status ;
564}
565
566sub Compress::Raw::Zlib::deflateStream::deflateParams
567{
568 my $self = shift ;
569 my ($got) = ParseParameters(0, {
570 'Level' => [1, 1, Parse_signed, undef],
571 'Strategy' => [1, 1, Parse_unsigned, undef],
572 'Bufsize' => [1, 1, Parse_unsigned, undef],
573 },
574 @_) ;
575
576 croak "Compress::Raw::Zlib::deflateParams needs Level and/or Strategy"
577 unless $got->parsed('Level') + $got->parsed('Strategy') +
578 $got->parsed('Bufsize');
579
580 croak "Compress::Raw::Zlib::Inflate::deflateParams: Bufsize must be >= 1, you specified " .
581 $got->value('Bufsize')
582 if $got->parsed('Bufsize') && $got->value('Bufsize') <= 1;
583
584 my $flags = 0;
585 $flags |= 1 if $got->parsed('Level') ;
586 $flags |= 2 if $got->parsed('Strategy') ;
587 $flags |= 4 if $got->parsed('Bufsize') ;
588
589 $self->_deflateParams($flags, $got->value('Level'),
590 $got->value('Strategy'), $got->value('Bufsize'));
591
592}
593
594
595135µs1;
596__END__
 
# spent 45µs within Compress::Raw::Zlib::CORE:match which was called 15 times, avg 3µs/call: # 12 times (36µs+0s) by Compress::Raw::Zlib::Parameters::_checkType at line 337, avg 3µs/call # 3 times (9µs+0s) by Compress::Raw::Zlib::Parameters::_checkType at line 329, avg 3µs/call
sub Compress::Raw::Zlib::CORE:match; # opcode
# spent 62µs within Compress::Raw::Zlib::CORE:subst which was called 24 times, avg 3µs/call: # 15 times (11µs+0s) by Compress::Raw::Zlib::Parameters::parse at line 261, avg 733ns/call # 9 times (51µs+0s) by Compress::Raw::Zlib::AUTOLOAD at line 110, avg 6µs/call
sub Compress::Raw::Zlib::CORE:subst; # opcode
# spent 1.10ms within Compress::Raw::Zlib::_inflateInit which was called 3 times, avg 366µs/call: # 3 times (1.10ms+0s) by Compress::Raw::Zlib::Inflate::new at line 468, avg 366µs/call
sub Compress::Raw::Zlib::_inflateInit; # xsub
# spent 25µs within Compress::Raw::Zlib::constant which was called 9 times, avg 3µs/call: # 9 times (25µs+0s) by Compress::Raw::Zlib::AUTOLOAD at line 111, avg 3µs/call
sub Compress::Raw::Zlib::constant; # xsub
# spent 18µs within Compress::Raw::Zlib::inflateStream::DESTROY which was called 3 times, avg 6µs/call: # 2 times (16µs+0s) by CPAN::Tarzip::gtest at line 158 of CPAN/Tarzip.pm, avg 8µs/call # once (2µs+0s) by CPAN::Distribution::CHECKSUM_check_file at line 1508 of CPAN/Distribution.pm
sub Compress::Raw::Zlib::inflateStream::DESTROY; # xsub
# spent 27.8ms within Compress::Raw::Zlib::inflateStream::inflate which was called 631 times, avg 44µs/call: # 631 times (27.8ms+0s) by IO::Uncompress::Adapter::Inflate::uncompr at line 63 of IO/Uncompress/Adapter/Inflate.pm, avg 44µs/call
sub Compress::Raw::Zlib::inflateStream::inflate; # xsub