← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 17:10:45 2013
Reported on Tue Oct 15 17:11:21 2013

Filename/usr/lib/perl/5.10/Compress/Raw/Zlib.pm
StatementsExecuted 14115 statements in 29.5ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
501165.4ms65.4msCompress::Raw::Zlib::::crc32 Compress::Raw::Zlib::crc32 (xsub)
50118.95ms14.4msCompress::Raw::Zlib::Parameters::::parse Compress::Raw::Zlib::Parameters::parse
500214.60ms5.13msCompress::Raw::Zlib::Parameters::::_checkType Compress::Raw::Zlib::Parameters::_checkType
50114.21ms24.0msCompress::Raw::Zlib::Inflate::::new Compress::Raw::Zlib::Inflate::new
50111.87ms17.2msCompress::Raw::Zlib::::ParseParameters Compress::Raw::Zlib::ParseParameters
450811.75ms1.75msCompress::Raw::Zlib::Parameters::::value Compress::Raw::Zlib::Parameters::value
350821.33ms1.33msCompress::Raw::Zlib::::__ANON__[:79] Compress::Raw::Zlib::__ANON__[:79]
5011835µs835µsCompress::Raw::Zlib::Parameters::::new Compress::Raw::Zlib::Parameters::new
5011759µs759µsCompress::Raw::Zlib::::_inflateInit Compress::Raw::Zlib::_inflateInit (xsub)
10021538µs538µsCompress::Raw::Zlib::::CORE:match Compress::Raw::Zlib::CORE:match (opcode)
10421383µs383µsCompress::Raw::Zlib::::CORE:subst Compress::Raw::Zlib::CORE:subst (opcode)
44194µs132µsCompress::Raw::Zlib::::AUTOLOAD Compress::Raw::Zlib::AUTOLOAD
11158µs110µsCompress::Raw::Zlib::::BEGIN@101 Compress::Raw::Zlib::BEGIN@101
11122µs54µsCompress::Raw::Zlib::::BEGIN@78 Compress::Raw::Zlib::BEGIN@78
41120µs20µsCompress::Raw::Zlib::::constant Compress::Raw::Zlib::constant (xsub)
11120µs158µsCompress::Raw::Zlib::::BEGIN@6 Compress::Raw::Zlib::BEGIN@6
11117µs88µsCompress::Raw::Zlib::::BEGIN@110 Compress::Raw::Zlib::BEGIN@110
11116µs85µsCompress::Raw::Zlib::::BEGIN@102 Compress::Raw::Zlib::BEGIN@102
11115µs68µsCompress::Raw::Zlib::::BEGIN@70 Compress::Raw::Zlib::BEGIN@70
11114µs65µsCompress::Raw::Zlib::::BEGIN@106 Compress::Raw::Zlib::BEGIN@106
11114µs88µsCompress::Raw::Zlib::::BEGIN@112 Compress::Raw::Zlib::BEGIN@112
11113µs78µsCompress::Raw::Zlib::::BEGIN@103 Compress::Raw::Zlib::BEGIN@103
11113µs46µsCompress::Raw::Zlib::::BEGIN@71 Compress::Raw::Zlib::BEGIN@71
11113µs56µsCompress::Raw::Zlib::::BEGIN@84 Compress::Raw::Zlib::BEGIN@84
11113µs52µsCompress::Raw::Zlib::::BEGIN@105 Compress::Raw::Zlib::BEGIN@105
11113µs68µsCompress::Raw::Zlib::::BEGIN@104 Compress::Raw::Zlib::BEGIN@104
11113µs62µsCompress::Raw::Zlib::::BEGIN@108 Compress::Raw::Zlib::BEGIN@108
11111µs57µsCompress::Raw::Zlib::::BEGIN@7 Compress::Raw::Zlib::BEGIN@7
11110µs49µsCompress::Raw::Zlib::::BEGIN@83 Compress::Raw::Zlib::BEGIN@83
11110µs73µsCompress::Raw::Zlib::::BEGIN@111 Compress::Raw::Zlib::BEGIN@111
11110µs14µsCompress::Raw::Zlib::::BEGIN@13 Compress::Raw::Zlib::BEGIN@13
11110µs13µsCompress::Raw::Zlib::::BEGIN@11 Compress::Raw::Zlib::BEGIN@11
11110µs46µsCompress::Raw::Zlib::::BEGIN@113 Compress::Raw::Zlib::BEGIN@113
11110µs23µsCompress::Raw::Zlib::::BEGIN@12 Compress::Raw::Zlib::BEGIN@12
1119µs40µsCompress::Raw::Zlib::::BEGIN@86 Compress::Raw::Zlib::BEGIN@86
1119µs42µsCompress::Raw::Zlib::::BEGIN@85 Compress::Raw::Zlib::BEGIN@85
1118µs45µsCompress::Raw::Zlib::::BEGIN@114 Compress::Raw::Zlib::BEGIN@114
1118µs39µsCompress::Raw::Zlib::::BEGIN@115 Compress::Raw::Zlib::BEGIN@115
1118µs37µsCompress::Raw::Zlib::::BEGIN@87 Compress::Raw::Zlib::BEGIN@87
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::::deflateParams Compress::Raw::Zlib::deflateStream::deflateParams
0000s0sCompress::Raw::Zlib::inflateScanStream::::createDeflateStreamCompress::Raw::Zlib::inflateScanStream::createDeflateStream
0000s0sCompress::Raw::Zlib::inflateScanStream::::inflateCompress::Raw::Zlib::inflateScanStream::inflate
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
4124µsrequire 5.004 ;
51800nsrequire Exporter;
6335µs2295µs
# spent 158µs (20+138) within Compress::Raw::Zlib::BEGIN@6 which was called: # once (20µs+138µs) by Compress::Zlib::BEGIN@12 at line 6
use AutoLoader;
# spent 158µs making 1 call to Compress::Raw::Zlib::BEGIN@6 # spent 138µs making 1 call to AutoLoader::import
7331µs2103µs
# spent 57µs (11+46) within Compress::Raw::Zlib::BEGIN@7 which was called: # once (11µs+46µs) by Compress::Zlib::BEGIN@12 at line 7
use Carp ;
# spent 57µs making 1 call to Compress::Raw::Zlib::BEGIN@7 # spent 46µs making 1 call to Exporter::import
8
9#use Parse::Parameters;
10
11324µs217µs
# spent 13µs (10+3) within Compress::Raw::Zlib::BEGIN@11 which was called: # once (10µs+3µs) by Compress::Zlib::BEGIN@12 at line 11
use strict ;
# spent 13µs making 1 call to Compress::Raw::Zlib::BEGIN@11 # spent 3µs making 1 call to strict::import
12326µs236µs
# spent 23µs (10+13) within Compress::Raw::Zlib::BEGIN@12 which was called: # once (10µs+13µs) by Compress::Zlib::BEGIN@12 at line 12
use warnings ;
# spent 23µs making 1 call to Compress::Raw::Zlib::BEGIN@12 # spent 13µs making 1 call to warnings::import
133158µs219µs
# spent 14µs (10+4) within Compress::Raw::Zlib::BEGIN@13 which was called: # once (10µs+4µs) by Compress::Zlib::BEGIN@12 at line 13
use bytes ;
# spent 14µs making 1 call to Compress::Raw::Zlib::BEGIN@13 # spent 4µs making 1 call to bytes::import
1412µsour ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
15
1611µs$VERSION = '2.020';
171600ns$XS_VERSION = $VERSION;
18139µs$VERSION = eval $VERSION;
# spent 47µs executing statements in string eval
19
20118µs@ISA = qw(Exporter);
21# Items to export into callers namespace by default. Note: do not export
22# names by default without a very good reason. Use EXPORT_OK instead.
23# Do not simply export all your public functions/methods/constants.
24112µs@EXPORT = qw(
25 adler32 crc32
26
27 ZLIB_VERSION
28 ZLIB_VERNUM
29
30 DEF_WBITS
31 OS_CODE
32
33 MAX_MEM_LEVEL
34 MAX_WBITS
35
36 Z_ASCII
37 Z_BEST_COMPRESSION
38 Z_BEST_SPEED
39 Z_BINARY
40 Z_BLOCK
41 Z_BUF_ERROR
42 Z_DATA_ERROR
43 Z_DEFAULT_COMPRESSION
44 Z_DEFAULT_STRATEGY
45 Z_DEFLATED
46 Z_ERRNO
47 Z_FILTERED
48 Z_FIXED
49 Z_FINISH
50 Z_FULL_FLUSH
51 Z_HUFFMAN_ONLY
52 Z_MEM_ERROR
53 Z_NEED_DICT
54 Z_NO_COMPRESSION
55 Z_NO_FLUSH
56 Z_NULL
57 Z_OK
58 Z_PARTIAL_FLUSH
59 Z_RLE
60 Z_STREAM_END
61 Z_STREAM_ERROR
62 Z_SYNC_FLUSH
63 Z_UNKNOWN
64 Z_VERSION_ERROR
65
66 WANT_GZIP
67 WANT_GZIP_OR_ZLIB
68);
69
70340µs2120µs
# spent 68µs (15+52) within Compress::Raw::Zlib::BEGIN@70 which was called: # once (15µs+52µs) by Compress::Zlib::BEGIN@12 at line 70
use constant WANT_GZIP => 16;
# spent 68µs making 1 call to Compress::Raw::Zlib::BEGIN@70 # spent 52µs making 1 call to constant::import
71393µs279µs
# spent 46µs (13+33) within Compress::Raw::Zlib::BEGIN@71 which was called: # once (13µs+33µs) by Compress::Zlib::BEGIN@12 at line 71
use constant WANT_GZIP_OR_ZLIB => 32;
# spent 46µs making 1 call to Compress::Raw::Zlib::BEGIN@71 # spent 33µs making 1 call to constant::import
72
73
# spent 132µs (94+38) within Compress::Raw::Zlib::AUTOLOAD which was called 4 times, avg 33µs/call: # once (42µs+21µs) by Compress::Zlib::_removeGzipHeader at line 484 of Compress/Zlib.pm # once (28µs+11µs) by Compress::Zlib::memGunzip at line 553 of Compress/Zlib.pm # once (13µs+4µs) by Compress::Zlib::_removeGzipHeader at line 529 of Compress/Zlib.pm # once (11µs+3µs) by Compress::Zlib::memGunzip at line 545 of Compress/Zlib.pm
sub AUTOLOAD {
7424132µs my($constname);
75418µs ($constname = $AUTOLOAD) =~ s/.*:://;
# spent 18µs making 4 calls to Compress::Raw::Zlib::CORE:subst, avg 5µs/call
76420µs my ($error, $val) = constant($constname);
# spent 20µs making 4 calls to Compress::Raw::Zlib::constant, avg 5µs/call
77 Carp::croak $error if $error;
78391µs286µs
# spent 54µs (22+32) within Compress::Raw::Zlib::BEGIN@78 which was called: # once (22µs+32µs) by Compress::Zlib::BEGIN@12 at line 78
no strict 'refs';
# spent 54µs making 1 call to Compress::Raw::Zlib::BEGIN@78 # spent 32µs making 1 call to strict::unimport
793501.42ms
# spent 1.33ms within Compress::Raw::Zlib::__ANON__[/usr/lib/perl/5.10/Compress/Raw/Zlib.pm:79] which was called 350 times, avg 4µs/call: # 50 times (93µs+0s) by Compress::Raw::Zlib::Inflate::new at line 415, avg 2µs/call # 50 times (86µs+0s) by Compress::Zlib::memGunzip at line 541 of Compress/Zlib.pm, avg 2µs/call # 50 times (77µs+0s) by Compress::Raw::Zlib::Inflate::new at line 388, avg 2µs/call # 49 times (419µs+0s) by Compress::Zlib::_removeGzipHeader at line 484 of Compress/Zlib.pm, avg 9µs/call # 49 times (269µs+0s) by Compress::Zlib::memGunzip at line 553 of Compress/Zlib.pm, avg 5µs/call # 49 times (198µs+0s) by Compress::Zlib::_removeGzipHeader at line 529 of Compress/Zlib.pm, avg 4µs/call # 49 times (183µs+0s) by Compress::Zlib::memGunzip at line 545 of Compress/Zlib.pm, avg 4µs/call # 4 times (6µs+0s) by Compress::Zlib::_removeGzipHeader or Compress::Zlib::memGunzip at line 80, avg 1µs/call
*{$AUTOLOAD} = sub { $val };
8046µs goto &{$AUTOLOAD};
# spent 6µs making 4 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:79], avg 1µs/call
81}
82
83345µs287µs
# spent 49µs (10+38) within Compress::Raw::Zlib::BEGIN@83 which was called: # once (10µs+38µs) by Compress::Zlib::BEGIN@12 at line 83
use constant FLAG_APPEND => 1 ;
# spent 49µs making 1 call to Compress::Raw::Zlib::BEGIN@83 # spent 38µs making 1 call to constant::import
84336µs299µs
# spent 56µs (13+43) within Compress::Raw::Zlib::BEGIN@84 which was called: # once (13µs+43µs) by Compress::Zlib::BEGIN@12 at line 84
use constant FLAG_CRC => 2 ;
# spent 56µs making 1 call to Compress::Raw::Zlib::BEGIN@84 # spent 43µs making 1 call to constant::import
85330µs275µs
# spent 42µs (9+33) within Compress::Raw::Zlib::BEGIN@85 which was called: # once (9µs+33µs) by Compress::Zlib::BEGIN@12 at line 85
use constant FLAG_ADLER => 4 ;
# spent 42µs making 1 call to Compress::Raw::Zlib::BEGIN@85 # spent 33µs making 1 call to constant::import
86328µs271µs
# spent 40µs (9+31) within Compress::Raw::Zlib::BEGIN@86 which was called: # once (9µs+31µs) by Compress::Zlib::BEGIN@12 at line 86
use constant FLAG_CONSUME_INPUT => 8 ;
# spent 40µs making 1 call to Compress::Raw::Zlib::BEGIN@86 # spent 31µs making 1 call to constant::import
87390µs267µs
# spent 37µs (8+30) within Compress::Raw::Zlib::BEGIN@87 which was called: # once (8µs+30µs) by Compress::Zlib::BEGIN@12 at line 87
use constant FLAG_LIMIT_OUTPUT => 16 ;
# spent 37µs making 1 call to Compress::Raw::Zlib::BEGIN@87 # spent 30µs making 1 call to constant::import
88
89eval {
9011µs require XSLoader;
911409µs1397µs XSLoader::load('Compress::Raw::Zlib', $XS_VERSION);
# spent 397µs making 1 call to XSLoader::load
921800ns 1;
93}
9412µsor do {
95 require DynaLoader;
96 local @ISA = qw(DynaLoader);
97 bootstrap Compress::Raw::Zlib $XS_VERSION ;
98};
99
100
101356µs2162µs
# spent 110µs (58+52) within Compress::Raw::Zlib::BEGIN@101 which was called: # once (58µs+52µs) by Compress::Zlib::BEGIN@12 at line 101
use constant Parse_any => 0x01;
# spent 110µs making 1 call to Compress::Raw::Zlib::BEGIN@101 # spent 52µs making 1 call to constant::import
102355µs2153µs
# spent 85µs (16+68) within Compress::Raw::Zlib::BEGIN@102 which was called: # once (16µs+68µs) by Compress::Zlib::BEGIN@12 at line 102
use constant Parse_unsigned => 0x02;
# spent 85µs making 1 call to Compress::Raw::Zlib::BEGIN@102 # spent 68µs making 1 call to constant::import
103345µs2143µs
# spent 78µs (13+65) within Compress::Raw::Zlib::BEGIN@103 which was called: # once (13µs+65µs) by Compress::Zlib::BEGIN@12 at line 103
use constant Parse_signed => 0x04;
# spent 78µs making 1 call to Compress::Raw::Zlib::BEGIN@103 # spent 65µs making 1 call to constant::import
104335µs2123µs
# spent 68µs (13+55) within Compress::Raw::Zlib::BEGIN@104 which was called: # once (13µs+55µs) by Compress::Zlib::BEGIN@12 at line 104
use constant Parse_boolean => 0x08;
# spent 68µs making 1 call to Compress::Raw::Zlib::BEGIN@104 # spent 55µs making 1 call to constant::import
105355µs290µs
# spent 52µs (13+39) within Compress::Raw::Zlib::BEGIN@105 which was called: # once (13µs+39µs) by Compress::Zlib::BEGIN@12 at line 105
use constant Parse_string => 0x10;
# spent 52µs making 1 call to Compress::Raw::Zlib::BEGIN@105 # spent 39µs making 1 call to constant::import
106338µs2116µs
# spent 65µs (14+51) within Compress::Raw::Zlib::BEGIN@106 which was called: # once (14µs+51µs) by Compress::Zlib::BEGIN@12 at line 106
use constant Parse_custom => 0x12;
# spent 65µs making 1 call to Compress::Raw::Zlib::BEGIN@106 # spent 51µs making 1 call to constant::import
107
108369µs2111µs
# spent 62µs (13+49) within Compress::Raw::Zlib::BEGIN@108 which was called: # once (13µs+49µs) by Compress::Zlib::BEGIN@12 at line 108
use constant Parse_store_ref => 0x100 ;
# spent 62µs making 1 call to Compress::Raw::Zlib::BEGIN@108 # spent 49µs making 1 call to constant::import
109
110340µs2158µs
# spent 88µs (17+71) within Compress::Raw::Zlib::BEGIN@110 which was called: # once (17µs+71µs) by Compress::Zlib::BEGIN@12 at line 110
use constant OFF_PARSED => 0 ;
# spent 88µs making 1 call to Compress::Raw::Zlib::BEGIN@110 # spent 71µs making 1 call to constant::import
111338µs2135µs
# spent 73µs (10+62) within Compress::Raw::Zlib::BEGIN@111 which was called: # once (10µs+62µs) by Compress::Zlib::BEGIN@12 at line 111
use constant OFF_TYPE => 1 ;
# spent 73µs making 1 call to Compress::Raw::Zlib::BEGIN@111 # spent 62µs making 1 call to constant::import
112340µs2163µs
# spent 88µs (14+75) within Compress::Raw::Zlib::BEGIN@112 which was called: # once (14µs+75µs) by Compress::Zlib::BEGIN@12 at line 112
use constant OFF_DEFAULT => 2 ;
# spent 88µs making 1 call to Compress::Raw::Zlib::BEGIN@112 # spent 74µs making 1 call to constant::import
113330µs282µs
# spent 46µs (10+36) within Compress::Raw::Zlib::BEGIN@113 which was called: # once (10µs+36µs) by Compress::Zlib::BEGIN@12 at line 113
use constant OFF_FIXED => 3 ;
# spent 46µs making 1 call to Compress::Raw::Zlib::BEGIN@113 # spent 36µs making 1 call to constant::import
114329µs281µs
# spent 45µs (8+36) within Compress::Raw::Zlib::BEGIN@114 which was called: # once (8µs+36µs) by Compress::Zlib::BEGIN@12 at line 114
use constant OFF_FIRST_ONLY => 4 ;
# spent 45µs making 1 call to Compress::Raw::Zlib::BEGIN@114 # spent 36µs making 1 call to constant::import
11532.42ms269µs
# spent 39µs (8+31) within Compress::Raw::Zlib::BEGIN@115 which was called: # once (8µs+31µs) by Compress::Zlib::BEGIN@12 at line 115
use constant OFF_STICKY => 5 ;
# spent 39µs making 1 call to Compress::Raw::Zlib::BEGIN@115 # spent 31µs making 1 call to constant::import
116
- -
119sub ParseParameters
120
# spent 17.2ms (1.87+15.3) within Compress::Raw::Zlib::ParseParameters which was called 50 times, avg 343µs/call: # 50 times (1.87ms+15.3ms) by Compress::Raw::Zlib::Inflate::new at line 388, avg 343µs/call
{
1212501.71ms my $level = shift || 0 ;
122
123 my $sub = (caller($level + 1))[3] ;
124 #local $Carp::CarpLevel = 1 ;
12550835µs my $p = new Compress::Raw::Zlib::Parameters() ;
# spent 835µs making 50 calls to Compress::Raw::Zlib::Parameters::new, avg 17µs/call
1265014.4ms $p->parse(@_)
# spent 14.4ms making 50 calls to Compress::Raw::Zlib::Parameters::parse, avg 289µs/call
127 or croak "$sub: $p->{Error}" ;
128
129 return $p;
130}
131
132
133sub Compress::Raw::Zlib::Parameters::new
134
# spent 835µs within Compress::Raw::Zlib::Parameters::new which was called 50 times, avg 17µs/call: # 50 times (835µs+0s) by Compress::Raw::Zlib::ParseParameters at line 125, avg 17µs/call
{
135150944µs my $class = shift ;
136
137 my $obj = { Error => '',
138 Got => {},
139 } ;
140
141 #return bless $obj, ref($class) || $class || __PACKAGE__ ;
142 return bless $obj, 'Compress::Raw::Zlib::Parameters' ;
143}
144
145sub Compress::Raw::Zlib::Parameters::setError
146{
147 my $self = shift ;
148 my $error = shift ;
149 my $retval = @_ ? shift : undef ;
150
151 $self->{Error} = $error ;
152 return $retval;
153}
154
155#sub getError
156#{
157# my $self = shift ;
158# return $self->{Error} ;
159#}
160
161sub Compress::Raw::Zlib::Parameters::parse
162
# spent 14.4ms (8.95+5.50) within Compress::Raw::Zlib::Parameters::parse which was called 50 times, avg 289µs/call: # 50 times (8.95ms+5.50ms) by Compress::Raw::Zlib::ParseParameters at line 126, avg 289µs/call
{
16347008.83ms my $self = shift ;
164
165 my $default = shift ;
166
167 my $got = $self->{Got} ;
168 my $firstTime = keys %{ $got } == 0 ;
169
170 my (@Bad) ;
171 my @entered = () ;
172
173 # Allow the options to be passed as a hash reference or
174 # as the complete hash.
175 if (@_ == 0) {
176 @entered = () ;
177 }
178 elsif (@_ == 1) {
179 my $href = $_[0] ;
180 return $self->setError("Expected even number of parameters, got 1")
181 if ! defined $href or ! ref $href or ref $href ne "HASH" ;
182
183 foreach my $key (keys %$href) {
184 push @entered, $key ;
185 push @entered, \$href->{$key} ;
186 }
187 }
188 else {
189 my $count = @_;
190 return $self->setError("Expected even number of parameters, got $count")
191 if $count % 2 != 0 ;
192
193 for my $i (0.. $count / 2 - 1) {
194 push @entered, $_[2* $i] ;
195 push @entered, \$_[2* $i+1] ;
196 }
197 }
198
199
200 while (my ($key, $v) = each %$default)
201 {
202 croak "need 4 params [@$v]"
203 if @$v != 4 ;
204
205 my ($first_only, $sticky, $type, $value) = @$v ;
206 my $x ;
2074003.49ms $self->_checkType($key, \$value, $type, 0, \$x)
# spent 3.49ms making 400 calls to Compress::Raw::Zlib::Parameters::_checkType, avg 9µs/call
208 or return undef ;
209
210 $key = lc $key;
211
212 if ($firstTime || ! $sticky) {
213 $got->{$key} = [0, $type, $value, $x, $first_only, $sticky] ;
214 }
215
216 $got->{$key}[OFF_PARSED] = 0 ;
217 }
218
219 for my $i (0.. @entered / 2 - 1) {
220 my $key = $entered[2* $i] ;
221 my $value = $entered[2* $i+1] ;
222
223 #print "Key [$key] Value [$value]" ;
224 #print defined $$value ? "[$$value]\n" : "[undef]\n";
225
226100365µs $key =~ s/^-// ;
# spent 365µs making 100 calls to Compress::Raw::Zlib::CORE:subst, avg 4µs/call
227 my $canonkey = lc $key;
228
229 if ($got->{$canonkey} && ($firstTime ||
230 ! $got->{$canonkey}[OFF_FIRST_ONLY] ))
231 {
232 my $type = $got->{$canonkey}[OFF_TYPE] ;
233 my $s ;
2341001.65ms $self->_checkType($key, $value, $type, 1, \$s)
# spent 1.65ms making 100 calls to Compress::Raw::Zlib::Parameters::_checkType, avg 16µs/call
235 or return undef ;
236 #$value = $$value unless $type & Parse_store_ref ;
237 $value = $$value ;
238 $got->{$canonkey} = [1, $type, $value, $s] ;
239 }
240 else
241 { push (@Bad, $key) }
242 }
243
244 if (@Bad) {
245 my ($bad) = join(", ", @Bad) ;
246 return $self->setError("unknown key value(s) @Bad") ;
247 }
248
249 return 1;
250}
251
252sub Compress::Raw::Zlib::Parameters::_checkType
253
# spent 5.13ms (4.60+538µs) within Compress::Raw::Zlib::Parameters::_checkType which was called 500 times, avg 10µs/call: # 400 times (3.49ms+0s) by Compress::Raw::Zlib::Parameters::parse at line 207, avg 9µs/call # 100 times (1.11ms+538µs) by Compress::Raw::Zlib::Parameters::parse at line 234, avg 16µs/call
{
25461505.68ms my $self = shift ;
255
256 my $key = shift ;
257 my $value = shift ;
258 my $type = shift ;
259 my $validate = shift ;
260 my $output = shift;
261
262 #local $Carp::CarpLevel = $level ;
263 #print "PARSE $type $key $value $validate $sub\n" ;
264 if ( $type & Parse_store_ref)
265 {
266 #$value = $$value
267 # if ref ${ $value } ;
268
269 $$output = $value ;
270 return 1;
271 }
272
273 $value = $$value ;
274
275 if ($type & Parse_any)
276 {
277 $$output = $value ;
278 return 1;
279 }
280 elsif ($type & Parse_unsigned)
281 {
282 return $self->setError("Parameter '$key' must be an unsigned int, got 'undef'")
283 if $validate && ! defined $value ;
28450281µs return $self->setError("Parameter '$key' must be an unsigned int, got '$value'")
# spent 281µs making 50 calls to Compress::Raw::Zlib::CORE:match, avg 6µs/call
285 if $validate && $value !~ /^\d+$/;
286
287 $$output = defined $value ? $value : 0 ;
288 return 1;
289 }
290 elsif ($type & Parse_signed)
291 {
292 return $self->setError("Parameter '$key' must be a signed int, got 'undef'")
293 if $validate && ! defined $value ;
29450257µs return $self->setError("Parameter '$key' must be a signed int, got '$value'")
# spent 257µs making 50 calls to Compress::Raw::Zlib::CORE:match, avg 5µs/call
295 if $validate && $value !~ /^-?\d+$/;
296
297 $$output = defined $value ? $value : 0 ;
298 return 1 ;
299 }
300 elsif ($type & Parse_boolean)
301 {
302 return $self->setError("Parameter '$key' must be an int, got '$value'")
303 if $validate && defined $value && $value !~ /^\d*$/;
304 $$output = defined $value ? $value != 0 : 0 ;
305 return 1;
306 }
307 elsif ($type & Parse_string)
308 {
309 $$output = defined $value ? $value : "" ;
310 return 1;
311 }
312
313 $$output = $value ;
314 return 1;
315}
316
- -
319sub Compress::Raw::Zlib::Parameters::parsed
320{
321 my $self = shift ;
322 my $name = shift ;
323
324 return $self->{Got}{lc $name}[OFF_PARSED] ;
325}
326
327sub Compress::Raw::Zlib::Parameters::value
328
# spent 1.75ms within Compress::Raw::Zlib::Parameters::value which was called 450 times, avg 4µs/call: # 100 times (393µs+0s) by Compress::Raw::Zlib::Inflate::new at line 418, avg 4µs/call # 50 times (388µs+0s) by Compress::Raw::Zlib::Inflate::new at line 402, avg 8µs/call # 50 times (225µs+0s) by Compress::Raw::Zlib::Inflate::new at line 407, avg 5µs/call # 50 times (154µs+0s) by Compress::Raw::Zlib::Inflate::new at line 408, avg 3µs/call # 50 times (151µs+0s) by Compress::Raw::Zlib::Inflate::new at line 414, avg 3µs/call # 50 times (148µs+0s) by Compress::Raw::Zlib::Inflate::new at line 409, avg 3µs/call # 50 times (144µs+0s) by Compress::Raw::Zlib::Inflate::new at line 411, avg 3µs/call # 50 times (142µs+0s) by Compress::Raw::Zlib::Inflate::new at line 410, avg 3µs/call
{
32918002.22ms my $self = shift ;
330 my $name = shift ;
331
332 if (@_)
333 {
334 $self->{Got}{lc $name}[OFF_PARSED] = 1;
335 $self->{Got}{lc $name}[OFF_DEFAULT] = $_[0] ;
336 $self->{Got}{lc $name}[OFF_FIXED] = $_[0] ;
337 }
338
339 return $self->{Got}{lc $name}[OFF_FIXED] ;
340}
341
342sub Compress::Raw::Zlib::Deflate::new
343{
344 my $pkg = shift ;
345 my ($got) = ParseParameters(0,
346 {
347 'AppendOutput' => [1, 1, Parse_boolean, 0],
348 'CRC32' => [1, 1, Parse_boolean, 0],
349 'ADLER32' => [1, 1, Parse_boolean, 0],
350 'Bufsize' => [1, 1, Parse_unsigned, 4096],
351
352 'Level' => [1, 1, Parse_signed, Z_DEFAULT_COMPRESSION()],
353 'Method' => [1, 1, Parse_unsigned, Z_DEFLATED()],
354 'WindowBits' => [1, 1, Parse_signed, MAX_WBITS()],
355 'MemLevel' => [1, 1, Parse_unsigned, MAX_MEM_LEVEL()],
356 'Strategy' => [1, 1, Parse_unsigned, Z_DEFAULT_STRATEGY()],
357 'Dictionary' => [1, 1, Parse_any, ""],
358 }, @_) ;
359
360
361 croak "Compress::Raw::Zlib::Deflate::new: Bufsize must be >= 1, you specified " .
362 $got->value('Bufsize')
363 unless $got->value('Bufsize') >= 1;
364
365 my $flags = 0 ;
366 $flags |= FLAG_APPEND if $got->value('AppendOutput') ;
367 $flags |= FLAG_CRC if $got->value('CRC32') ;
368 $flags |= FLAG_ADLER if $got->value('ADLER32') ;
369
370 my $windowBits = $got->value('WindowBits');
371 $windowBits += MAX_WBITS()
372 if ($windowBits & MAX_WBITS()) == 0 ;
373
374 _deflateInit($flags,
375 $got->value('Level'),
376 $got->value('Method'),
377 $windowBits,
378 $got->value('MemLevel'),
379 $got->value('Strategy'),
380 $got->value('Bufsize'),
381 $got->value('Dictionary')) ;
382
383}
384
385sub Compress::Raw::Zlib::Inflate::new
386
# spent 24.0ms (4.21+19.8) within Compress::Raw::Zlib::Inflate::new which was called 50 times, avg 481µs/call: # 50 times (4.21ms+19.8ms) by Compress::Zlib::memGunzip at line 545 of Compress/Zlib.pm, avg 481µs/call
{
3876004.35ms my $pkg = shift ;
38810017.2ms my ($got) = ParseParameters(0,
# spent 17.2ms making 50 calls to Compress::Raw::Zlib::ParseParameters, avg 343µs/call # spent 77µs making 50 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:79], avg 2µs/call
389 {
390 'AppendOutput' => [1, 1, Parse_boolean, 0],
391 'LimitOutput' => [1, 1, Parse_boolean, 0],
392 'CRC32' => [1, 1, Parse_boolean, 0],
393 'ADLER32' => [1, 1, Parse_boolean, 0],
394 'ConsumeInput' => [1, 1, Parse_boolean, 1],
395 'Bufsize' => [1, 1, Parse_unsigned, 4096],
396
397 'WindowBits' => [1, 1, Parse_signed, MAX_WBITS()],
398 'Dictionary' => [1, 1, Parse_any, ""],
399 }, @_) ;
400
401
40250388µs croak "Compress::Raw::Zlib::Inflate::new: Bufsize must be >= 1, you specified " .
# spent 388µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 8µs/call
403 $got->value('Bufsize')
404 unless $got->value('Bufsize') >= 1;
405
406 my $flags = 0 ;
40750225µs $flags |= FLAG_APPEND if $got->value('AppendOutput') ;
# spent 225µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 5µs/call
40850154µs $flags |= FLAG_CRC if $got->value('CRC32') ;
# spent 154µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call
40950148µs $flags |= FLAG_ADLER if $got->value('ADLER32') ;
# spent 148µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call
41050142µs $flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ;
# spent 142µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call
41150144µs $flags |= FLAG_LIMIT_OUTPUT if $got->value('LimitOutput') ;
# spent 144µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call
412
413
41450151µs my $windowBits = $got->value('WindowBits');
# spent 151µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call
4155093µs $windowBits += MAX_WBITS()
# spent 93µs making 50 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:79], avg 2µs/call
416 if ($windowBits & MAX_WBITS()) == 0 ;
417
4181501.15ms _inflateInit($flags, $windowBits, $got->value('Bufsize'),
# spent 759µs making 50 calls to Compress::Raw::Zlib::_inflateInit, avg 15µs/call # spent 393µs making 100 calls to Compress::Raw::Zlib::Parameters::value, avg 4µs/call
419 $got->value('Dictionary')) ;
420}
421
422sub Compress::Raw::Zlib::InflateScan::new
423{
424 my $pkg = shift ;
425 my ($got) = ParseParameters(0,
426 {
427 'CRC32' => [1, 1, Parse_boolean, 0],
428 'ADLER32' => [1, 1, Parse_boolean, 0],
429 'Bufsize' => [1, 1, Parse_unsigned, 4096],
430
431 'WindowBits' => [1, 1, Parse_signed, -MAX_WBITS()],
432 'Dictionary' => [1, 1, Parse_any, ""],
433 }, @_) ;
434
435
436 croak "Compress::Raw::Zlib::InflateScan::new: Bufsize must be >= 1, you specified " .
437 $got->value('Bufsize')
438 unless $got->value('Bufsize') >= 1;
439
440 my $flags = 0 ;
441 #$flags |= FLAG_APPEND if $got->value('AppendOutput') ;
442 $flags |= FLAG_CRC if $got->value('CRC32') ;
443 $flags |= FLAG_ADLER if $got->value('ADLER32') ;
444 #$flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ;
445
446 _inflateScanInit($flags, $got->value('WindowBits'), $got->value('Bufsize'),
447 '') ;
448}
449
450sub Compress::Raw::Zlib::inflateScanStream::createDeflateStream
451{
452 my $pkg = shift ;
453 my ($got) = ParseParameters(0,
454 {
455 'AppendOutput' => [1, 1, Parse_boolean, 0],
456 'CRC32' => [1, 1, Parse_boolean, 0],
457 'ADLER32' => [1, 1, Parse_boolean, 0],
458 'Bufsize' => [1, 1, Parse_unsigned, 4096],
459
460 'Level' => [1, 1, Parse_signed, Z_DEFAULT_COMPRESSION()],
461 'Method' => [1, 1, Parse_unsigned, Z_DEFLATED()],
462 'WindowBits' => [1, 1, Parse_signed, - MAX_WBITS()],
463 'MemLevel' => [1, 1, Parse_unsigned, MAX_MEM_LEVEL()],
464 'Strategy' => [1, 1, Parse_unsigned, Z_DEFAULT_STRATEGY()],
465 }, @_) ;
466
467 croak "Compress::Raw::Zlib::InflateScan::createDeflateStream: Bufsize must be >= 1, you specified " .
468 $got->value('Bufsize')
469 unless $got->value('Bufsize') >= 1;
470
471 my $flags = 0 ;
472 $flags |= FLAG_APPEND if $got->value('AppendOutput') ;
473 $flags |= FLAG_CRC if $got->value('CRC32') ;
474 $flags |= FLAG_ADLER if $got->value('ADLER32') ;
475
476 $pkg->_createDeflateStream($flags,
477 $got->value('Level'),
478 $got->value('Method'),
479 $got->value('WindowBits'),
480 $got->value('MemLevel'),
481 $got->value('Strategy'),
482 $got->value('Bufsize'),
483 ) ;
484
485}
486
487sub Compress::Raw::Zlib::inflateScanStream::inflate
488{
489 my $self = shift ;
490 my $buffer = $_[1];
491 my $eof = $_[2];
492
493 my $status = $self->scan(@_);
494
495 if ($status == Z_OK() && $_[2]) {
496 my $byte = ' ';
497
498 $status = $self->scan(\$byte, $_[1]) ;
499 }
500
501 return $status ;
502}
503
504sub Compress::Raw::Zlib::deflateStream::deflateParams
505{
506 my $self = shift ;
507 my ($got) = ParseParameters(0, {
508 'Level' => [1, 1, Parse_signed, undef],
509 'Strategy' => [1, 1, Parse_unsigned, undef],
510 'Bufsize' => [1, 1, Parse_unsigned, undef],
511 },
512 @_) ;
513
514 croak "Compress::Raw::Zlib::deflateParams needs Level and/or Strategy"
515 unless $got->parsed('Level') + $got->parsed('Strategy') +
516 $got->parsed('Bufsize');
517
518 croak "Compress::Raw::Zlib::Inflate::deflateParams: Bufsize must be >= 1, you specified " .
519 $got->value('Bufsize')
520 if $got->parsed('Bufsize') && $got->value('Bufsize') <= 1;
521
522 my $flags = 0;
523 $flags |= 1 if $got->parsed('Level') ;
524 $flags |= 2 if $got->parsed('Strategy') ;
525 $flags |= 4 if $got->parsed('Bufsize') ;
526
527 $self->_deflateParams($flags, $got->value('Level'),
528 $got->value('Strategy'), $got->value('Bufsize'));
529
530}
531
532
533# Autoload methods go after __END__, and are processed by the autosplit program.
534
535115µs1;
536__END__
 
# spent 538µs within Compress::Raw::Zlib::CORE:match which was called 100 times, avg 5µs/call: # 50 times (281µs+0s) by Compress::Raw::Zlib::Parameters::_checkType at line 284, avg 6µs/call # 50 times (257µs+0s) by Compress::Raw::Zlib::Parameters::_checkType at line 294, avg 5µs/call
sub Compress::Raw::Zlib::CORE:match; # opcode
# spent 383µs within Compress::Raw::Zlib::CORE:subst which was called 104 times, avg 4µs/call: # 100 times (365µs+0s) by Compress::Raw::Zlib::Parameters::parse at line 226, avg 4µs/call # 4 times (18µs+0s) by Compress::Raw::Zlib::AUTOLOAD at line 75, avg 5µs/call
sub Compress::Raw::Zlib::CORE:subst; # opcode
# spent 759µs within Compress::Raw::Zlib::_inflateInit which was called 50 times, avg 15µs/call: # 50 times (759µs+0s) by Compress::Raw::Zlib::Inflate::new at line 418, avg 15µs/call
sub Compress::Raw::Zlib::_inflateInit; # xsub
# spent 20µs within Compress::Raw::Zlib::constant which was called 4 times, avg 5µs/call: # 4 times (20µs+0s) by Compress::Raw::Zlib::AUTOLOAD at line 76, avg 5µs/call
sub Compress::Raw::Zlib::constant; # xsub
# spent 65.4ms within Compress::Raw::Zlib::crc32 which was called 50 times, avg 1.31ms/call: # 50 times (65.4ms+0s) by Compress::Zlib::memGunzip at line 560 of Compress/Zlib.pm, avg 1.31ms/call
sub Compress::Raw::Zlib::crc32; # xsub