Filename | /usr/lib/perl/5.10/Compress/Raw/Zlib.pm |
Statements | Executed 14115 statements in 29.5ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
50 | 1 | 1 | 65.4ms | 65.4ms | crc32 (xsub) | Compress::Raw::Zlib::
50 | 1 | 1 | 8.95ms | 14.4ms | parse | Compress::Raw::Zlib::Parameters::
500 | 2 | 1 | 4.60ms | 5.13ms | _checkType | Compress::Raw::Zlib::Parameters::
50 | 1 | 1 | 4.21ms | 24.0ms | new | Compress::Raw::Zlib::Inflate::
50 | 1 | 1 | 1.87ms | 17.2ms | ParseParameters | Compress::Raw::Zlib::
450 | 8 | 1 | 1.75ms | 1.75ms | value | Compress::Raw::Zlib::Parameters::
350 | 8 | 2 | 1.33ms | 1.33ms | __ANON__[:79] | Compress::Raw::Zlib::
50 | 1 | 1 | 835µs | 835µs | new | Compress::Raw::Zlib::Parameters::
50 | 1 | 1 | 759µs | 759µs | _inflateInit (xsub) | Compress::Raw::Zlib::
100 | 2 | 1 | 538µs | 538µs | CORE:match (opcode) | Compress::Raw::Zlib::
104 | 2 | 1 | 383µs | 383µs | CORE:subst (opcode) | Compress::Raw::Zlib::
4 | 4 | 1 | 94µs | 132µs | AUTOLOAD | Compress::Raw::Zlib::
1 | 1 | 1 | 58µs | 110µs | BEGIN@101 | Compress::Raw::Zlib::
1 | 1 | 1 | 22µs | 54µs | BEGIN@78 | Compress::Raw::Zlib::
4 | 1 | 1 | 20µs | 20µs | constant (xsub) | Compress::Raw::Zlib::
1 | 1 | 1 | 20µs | 158µs | BEGIN@6 | Compress::Raw::Zlib::
1 | 1 | 1 | 17µs | 88µs | BEGIN@110 | Compress::Raw::Zlib::
1 | 1 | 1 | 16µs | 85µs | BEGIN@102 | Compress::Raw::Zlib::
1 | 1 | 1 | 15µs | 68µs | BEGIN@70 | Compress::Raw::Zlib::
1 | 1 | 1 | 14µs | 65µs | BEGIN@106 | Compress::Raw::Zlib::
1 | 1 | 1 | 14µs | 88µs | BEGIN@112 | Compress::Raw::Zlib::
1 | 1 | 1 | 13µs | 78µs | BEGIN@103 | Compress::Raw::Zlib::
1 | 1 | 1 | 13µs | 46µs | BEGIN@71 | Compress::Raw::Zlib::
1 | 1 | 1 | 13µs | 56µs | BEGIN@84 | Compress::Raw::Zlib::
1 | 1 | 1 | 13µs | 52µs | BEGIN@105 | Compress::Raw::Zlib::
1 | 1 | 1 | 13µs | 68µs | BEGIN@104 | Compress::Raw::Zlib::
1 | 1 | 1 | 13µs | 62µs | BEGIN@108 | Compress::Raw::Zlib::
1 | 1 | 1 | 11µs | 57µs | BEGIN@7 | Compress::Raw::Zlib::
1 | 1 | 1 | 10µs | 49µs | BEGIN@83 | Compress::Raw::Zlib::
1 | 1 | 1 | 10µs | 73µs | BEGIN@111 | Compress::Raw::Zlib::
1 | 1 | 1 | 10µs | 14µs | BEGIN@13 | Compress::Raw::Zlib::
1 | 1 | 1 | 10µs | 13µs | BEGIN@11 | Compress::Raw::Zlib::
1 | 1 | 1 | 10µs | 46µs | BEGIN@113 | Compress::Raw::Zlib::
1 | 1 | 1 | 10µs | 23µs | BEGIN@12 | Compress::Raw::Zlib::
1 | 1 | 1 | 9µs | 40µs | BEGIN@86 | Compress::Raw::Zlib::
1 | 1 | 1 | 9µs | 42µs | BEGIN@85 | Compress::Raw::Zlib::
1 | 1 | 1 | 8µs | 45µs | BEGIN@114 | Compress::Raw::Zlib::
1 | 1 | 1 | 8µs | 39µs | BEGIN@115 | Compress::Raw::Zlib::
1 | 1 | 1 | 8µs | 37µs | BEGIN@87 | Compress::Raw::Zlib::
0 | 0 | 0 | 0s | 0s | new | Compress::Raw::Zlib::Deflate::
0 | 0 | 0 | 0s | 0s | new | Compress::Raw::Zlib::InflateScan::
0 | 0 | 0 | 0s | 0s | parsed | Compress::Raw::Zlib::Parameters::
0 | 0 | 0 | 0s | 0s | setError | Compress::Raw::Zlib::Parameters::
0 | 0 | 0 | 0s | 0s | deflateParams | Compress::Raw::Zlib::deflateStream::
0 | 0 | 0 | 0s | 0s | createDeflateStream | Compress::Raw::Zlib::inflateScanStream::
0 | 0 | 0 | 0s | 0s | inflate | Compress::Raw::Zlib::inflateScanStream::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | |||||
2 | package Compress::Raw::Zlib; | ||||
3 | |||||
4 | 1 | 24µs | require 5.004 ; | ||
5 | 1 | 800ns | require Exporter; | ||
6 | 3 | 35µs | 2 | 295µ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 # spent 158µs making 1 call to Compress::Raw::Zlib::BEGIN@6
# spent 138µs making 1 call to AutoLoader::import |
7 | 3 | 31µs | 2 | 103µ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 # 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 | |||||
11 | 3 | 24µs | 2 | 17µ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 # spent 13µs making 1 call to Compress::Raw::Zlib::BEGIN@11
# spent 3µs making 1 call to strict::import |
12 | 3 | 26µs | 2 | 36µ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 # spent 23µs making 1 call to Compress::Raw::Zlib::BEGIN@12
# spent 13µs making 1 call to warnings::import |
13 | 3 | 158µs | 2 | 19µ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 # spent 14µs making 1 call to Compress::Raw::Zlib::BEGIN@13
# spent 4µs making 1 call to bytes::import |
14 | 1 | 2µs | our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD); | ||
15 | |||||
16 | 1 | 1µs | $VERSION = '2.020'; | ||
17 | 1 | 600ns | $XS_VERSION = $VERSION; | ||
18 | 1 | 39µs | $VERSION = eval $VERSION; # spent 47µs executing statements in string eval | ||
19 | |||||
20 | 1 | 18µ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. | ||||
24 | 1 | 12µ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 | |||||
70 | 3 | 40µs | 2 | 120µ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 # spent 68µs making 1 call to Compress::Raw::Zlib::BEGIN@70
# spent 52µs making 1 call to constant::import |
71 | 3 | 93µs | 2 | 79µ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 # 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 | ||||
74 | 4 | 1µs | my($constname); | ||
75 | 4 | 35µs | 4 | 18µs | ($constname = $AUTOLOAD) =~ s/.*:://; # spent 18µs making 4 calls to Compress::Raw::Zlib::CORE:subst, avg 5µs/call |
76 | 4 | 34µs | 4 | 20µs | my ($error, $val) = constant($constname); # spent 20µs making 4 calls to Compress::Raw::Zlib::constant, avg 5µs/call |
77 | 4 | 2µs | Carp::croak $error if $error; | ||
78 | 3 | 91µs | 2 | 86µ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 # spent 54µs making 1 call to Compress::Raw::Zlib::BEGIN@78
# spent 32µs making 1 call to strict::unimport |
79 | 354 | 1.45ms | # 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 | ||
80 | 4 | 29µs | 4 | 6µ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 | |||||
83 | 3 | 45µs | 2 | 87µ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 # spent 49µs making 1 call to Compress::Raw::Zlib::BEGIN@83
# spent 38µs making 1 call to constant::import |
84 | 3 | 36µs | 2 | 99µ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 # spent 56µs making 1 call to Compress::Raw::Zlib::BEGIN@84
# spent 43µs making 1 call to constant::import |
85 | 3 | 30µs | 2 | 75µ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 # spent 42µs making 1 call to Compress::Raw::Zlib::BEGIN@85
# spent 33µs making 1 call to constant::import |
86 | 3 | 28µs | 2 | 71µ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 # spent 40µs making 1 call to Compress::Raw::Zlib::BEGIN@86
# spent 31µs making 1 call to constant::import |
87 | 3 | 90µs | 2 | 67µ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 # spent 37µs making 1 call to Compress::Raw::Zlib::BEGIN@87
# spent 30µs making 1 call to constant::import |
88 | |||||
89 | eval { | ||||
90 | 1 | 1µs | require XSLoader; | ||
91 | 1 | 409µs | 1 | 397µs | XSLoader::load('Compress::Raw::Zlib', $XS_VERSION); # spent 397µs making 1 call to XSLoader::load |
92 | 1 | 800ns | 1; | ||
93 | } | ||||
94 | 1 | 2µs | or do { | ||
95 | require DynaLoader; | ||||
96 | local @ISA = qw(DynaLoader); | ||||
97 | bootstrap Compress::Raw::Zlib $XS_VERSION ; | ||||
98 | }; | ||||
99 | |||||
100 | |||||
101 | 3 | 56µs | 2 | 162µ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 # spent 110µs making 1 call to Compress::Raw::Zlib::BEGIN@101
# spent 52µs making 1 call to constant::import |
102 | 3 | 55µs | 2 | 153µ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 # spent 85µs making 1 call to Compress::Raw::Zlib::BEGIN@102
# spent 68µs making 1 call to constant::import |
103 | 3 | 45µs | 2 | 143µ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 # spent 78µs making 1 call to Compress::Raw::Zlib::BEGIN@103
# spent 65µs making 1 call to constant::import |
104 | 3 | 35µs | 2 | 123µ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 # spent 68µs making 1 call to Compress::Raw::Zlib::BEGIN@104
# spent 55µs making 1 call to constant::import |
105 | 3 | 55µs | 2 | 90µ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 # spent 52µs making 1 call to Compress::Raw::Zlib::BEGIN@105
# spent 39µs making 1 call to constant::import |
106 | 3 | 38µs | 2 | 116µ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 # spent 65µs making 1 call to Compress::Raw::Zlib::BEGIN@106
# spent 51µs making 1 call to constant::import |
107 | |||||
108 | 3 | 69µs | 2 | 111µ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 # spent 62µs making 1 call to Compress::Raw::Zlib::BEGIN@108
# spent 49µs making 1 call to constant::import |
109 | |||||
110 | 3 | 40µs | 2 | 158µ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 # spent 88µs making 1 call to Compress::Raw::Zlib::BEGIN@110
# spent 71µs making 1 call to constant::import |
111 | 3 | 38µs | 2 | 135µ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 # spent 73µs making 1 call to Compress::Raw::Zlib::BEGIN@111
# spent 62µs making 1 call to constant::import |
112 | 3 | 40µs | 2 | 163µ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 # spent 88µs making 1 call to Compress::Raw::Zlib::BEGIN@112
# spent 74µs making 1 call to constant::import |
113 | 3 | 30µs | 2 | 82µ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 # spent 46µs making 1 call to Compress::Raw::Zlib::BEGIN@113
# spent 36µs making 1 call to constant::import |
114 | 3 | 29µs | 2 | 81µ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 # spent 45µs making 1 call to Compress::Raw::Zlib::BEGIN@114
# spent 36µs making 1 call to constant::import |
115 | 3 | 2.42ms | 2 | 69µ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 # spent 39µs making 1 call to Compress::Raw::Zlib::BEGIN@115
# spent 31µs making 1 call to constant::import |
116 | |||||
- - | |||||
119 | sub 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 | ||||
121 | 50 | 78µs | my $level = shift || 0 ; | ||
122 | |||||
123 | 50 | 811µs | my $sub = (caller($level + 1))[3] ; | ||
124 | #local $Carp::CarpLevel = 1 ; | ||||
125 | 50 | 374µs | 50 | 835µs | my $p = new Compress::Raw::Zlib::Parameters() ; # spent 835µs making 50 calls to Compress::Raw::Zlib::Parameters::new, avg 17µs/call |
126 | 50 | 231µs | 50 | 14.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 | 50 | 218µs | return $p; | ||
130 | } | ||||
131 | |||||
132 | |||||
133 | sub 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 | ||||
135 | 50 | 84µs | my $class = shift ; | ||
136 | |||||
137 | 50 | 234µs | my $obj = { Error => '', | ||
138 | Got => {}, | ||||
139 | } ; | ||||
140 | |||||
141 | #return bless $obj, ref($class) || $class || __PACKAGE__ ; | ||||
142 | 50 | 625µs | return bless $obj, 'Compress::Raw::Zlib::Parameters' ; | ||
143 | } | ||||
144 | |||||
145 | sub 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 | |||||
161 | sub 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 | ||||
163 | 50 | 37µs | my $self = shift ; | ||
164 | |||||
165 | 50 | 39µs | my $default = shift ; | ||
166 | |||||
167 | 50 | 81µs | my $got = $self->{Got} ; | ||
168 | 50 | 136µs | my $firstTime = keys %{ $got } == 0 ; | ||
169 | |||||
170 | 50 | 33µs | my (@Bad) ; | ||
171 | 50 | 59µs | my @entered = () ; | ||
172 | |||||
173 | # Allow the options to be passed as a hash reference or | ||||
174 | # as the complete hash. | ||||
175 | 50 | 115µs | if (@_ == 0) { | ||
176 | @entered = () ; | ||||
177 | } | ||||
178 | elsif (@_ == 1) { | ||||
179 | 50 | 38µs | my $href = $_[0] ; | ||
180 | 50 | 213µs | return $self->setError("Expected even number of parameters, got 1") | ||
181 | if ! defined $href or ! ref $href or ref $href ne "HASH" ; | ||||
182 | |||||
183 | 50 | 150µs | foreach my $key (keys %$href) { | ||
184 | 100 | 67µs | push @entered, $key ; | ||
185 | 100 | 197µs | 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 | 50 | 856µs | while (my ($key, $v) = each %$default) | ||
201 | { | ||||
202 | 400 | 235µs | croak "need 4 params [@$v]" | ||
203 | if @$v != 4 ; | ||||
204 | |||||
205 | 400 | 359µs | my ($first_only, $sticky, $type, $value) = @$v ; | ||
206 | 400 | 101µs | my $x ; | ||
207 | 400 | 1.32ms | 400 | 3.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 | 400 | 307µs | $key = lc $key; | ||
211 | |||||
212 | 400 | 1.39ms | if ($firstTime || ! $sticky) { | ||
213 | $got->{$key} = [0, $type, $value, $x, $first_only, $sticky] ; | ||||
214 | } | ||||
215 | |||||
216 | 400 | 445µs | $got->{$key}[OFF_PARSED] = 0 ; | ||
217 | } | ||||
218 | |||||
219 | 50 | 251µs | for my $i (0.. @entered / 2 - 1) { | ||
220 | 100 | 118µs | my $key = $entered[2* $i] ; | ||
221 | 100 | 139µs | my $value = $entered[2* $i+1] ; | ||
222 | |||||
223 | #print "Key [$key] Value [$value]" ; | ||||
224 | #print defined $$value ? "[$$value]\n" : "[undef]\n"; | ||||
225 | |||||
226 | 100 | 752µs | 100 | 365µs | $key =~ s/^-// ; # spent 365µs making 100 calls to Compress::Raw::Zlib::CORE:subst, avg 4µs/call |
227 | 100 | 130µs | my $canonkey = lc $key; | ||
228 | |||||
229 | 100 | 302µs | if ($got->{$canonkey} && ($firstTime || | ||
230 | ! $got->{$canonkey}[OFF_FIRST_ONLY] )) | ||||
231 | { | ||||
232 | 100 | 87µs | my $type = $got->{$canonkey}[OFF_TYPE] ; | ||
233 | 100 | 33µs | my $s ; | ||
234 | 100 | 313µs | 100 | 1.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 | 100 | 46µs | $value = $$value ; | ||
238 | 100 | 217µs | $got->{$canonkey} = [1, $type, $value, $s] ; | ||
239 | } | ||||
240 | else | ||||
241 | { push (@Bad, $key) } | ||||
242 | } | ||||
243 | |||||
244 | 50 | 35µs | if (@Bad) { | ||
245 | my ($bad) = join(", ", @Bad) ; | ||||
246 | return $self->setError("unknown key value(s) @Bad") ; | ||||
247 | } | ||||
248 | |||||
249 | 50 | 233µs | return 1; | ||
250 | } | ||||
251 | |||||
252 | sub 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 | ||||
254 | 500 | 303µs | my $self = shift ; | ||
255 | |||||
256 | 500 | 267µs | my $key = shift ; | ||
257 | 500 | 188µs | my $value = shift ; | ||
258 | 500 | 170µs | my $type = shift ; | ||
259 | 500 | 162µs | my $validate = shift ; | ||
260 | 500 | 158µs | my $output = shift; | ||
261 | |||||
262 | #local $Carp::CarpLevel = $level ; | ||||
263 | #print "PARSE $type $key $value $validate $sub\n" ; | ||||
264 | 500 | 234µs | if ( $type & Parse_store_ref) | ||
265 | { | ||||
266 | #$value = $$value | ||||
267 | # if ref ${ $value } ; | ||||
268 | |||||
269 | $$output = $value ; | ||||
270 | return 1; | ||||
271 | } | ||||
272 | |||||
273 | 500 | 271µs | $value = $$value ; | ||
274 | |||||
275 | 500 | 415µs | if ($type & Parse_any) | ||
276 | { | ||||
277 | 50 | 23µs | $$output = $value ; | ||
278 | 50 | 194µs | return 1; | ||
279 | } | ||||
280 | elsif ($type & Parse_unsigned) | ||||
281 | { | ||||
282 | 100 | 54µs | return $self->setError("Parameter '$key' must be an unsigned int, got 'undef'") | ||
283 | if $validate && ! defined $value ; | ||||
284 | 100 | 507µs | 50 | 281µ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 | 100 | 76µs | $$output = defined $value ? $value : 0 ; | ||
288 | 100 | 402µs | return 1; | ||
289 | } | ||||
290 | elsif ($type & Parse_signed) | ||||
291 | { | ||||
292 | 100 | 54µs | return $self->setError("Parameter '$key' must be a signed int, got 'undef'") | ||
293 | if $validate && ! defined $value ; | ||||
294 | 100 | 426µs | 50 | 257µ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 | 100 | 64µs | $$output = defined $value ? $value : 0 ; | ||
298 | 100 | 324µs | return 1 ; | ||
299 | } | ||||
300 | elsif ($type & Parse_boolean) | ||||
301 | { | ||||
302 | 250 | 91µs | return $self->setError("Parameter '$key' must be an int, got '$value'") | ||
303 | if $validate && defined $value && $value !~ /^\d*$/; | ||||
304 | 250 | 175µs | $$output = defined $value ? $value != 0 : 0 ; | ||
305 | 250 | 1.12ms | 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 | |||||
- - | |||||
319 | sub 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 | |||||
327 | sub 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 | ||||
329 | 450 | 213µs | my $self = shift ; | ||
330 | 450 | 192µs | my $name = shift ; | ||
331 | |||||
332 | 450 | 143µs | 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 | 450 | 1.67ms | return $self->{Got}{lc $name}[OFF_FIXED] ; | ||
340 | } | ||||
341 | |||||
342 | sub 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 | |||||
385 | sub 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 | ||||
387 | 50 | 56µs | my $pkg = shift ; | ||
388 | 50 | 1.47ms | 100 | 17.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 | |||||
402 | 50 | 246µs | 50 | 388µ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 | 50 | 37µs | my $flags = 0 ; | ||
407 | 50 | 144µs | 50 | 225µs | $flags |= FLAG_APPEND if $got->value('AppendOutput') ; # spent 225µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 5µs/call |
408 | 50 | 109µs | 50 | 154µs | $flags |= FLAG_CRC if $got->value('CRC32') ; # spent 154µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call |
409 | 50 | 103µs | 50 | 148µs | $flags |= FLAG_ADLER if $got->value('ADLER32') ; # spent 148µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call |
410 | 50 | 143µs | 50 | 142µ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 |
411 | 50 | 102µs | 50 | 144µ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 | |||||
414 | 50 | 121µs | 50 | 151µs | my $windowBits = $got->value('WindowBits'); # spent 151µs making 50 calls to Compress::Raw::Zlib::Parameters::value, avg 3µs/call |
415 | 50 | 143µs | 50 | 93µ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 | |||||
418 | 50 | 1.67ms | 150 | 1.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 | |||||
422 | sub 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 | |||||
450 | sub 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 | |||||
487 | sub 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 | |||||
504 | sub 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 | |||||
535 | 1 | 15µs | 1; | ||
536 | __END__ | ||||
sub Compress::Raw::Zlib::CORE:match; # opcode | |||||
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 | |||||
# 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 | |||||
# 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 |