| Filename | /usr/libdata/perl5/amd64-openbsd/Compress/Raw/Zlib.pm |
| Statements | Executed 14244 statements in 74.6ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 40 | 1 | 1 | 28.3ms | 39.5ms | Compress::Raw::Zlib::Parameters::parse |
| 40 | 1 | 1 | 15.1ms | 66.5ms | Compress::Raw::Zlib::Inflate::new |
| 182 | 1 | 1 | 13.2ms | 13.2ms | Compress::Raw::Zlib::inflateStream::inflate (xsub) |
| 520 | 2 | 1 | 7.59ms | 10.0ms | Compress::Raw::Zlib::Parameters::_checkType |
| 895 | 9 | 2 | 4.60ms | 4.60ms | Compress::Raw::Zlib::__ANON__[:114] |
| 40 | 1 | 1 | 4.19ms | 44.9ms | Compress::Raw::Zlib::ParseParameters |
| 360 | 8 | 1 | 3.63ms | 3.63ms | Compress::Raw::Zlib::Parameters::value |
| 40 | 1 | 1 | 2.82ms | 2.82ms | Compress::Raw::Zlib::_inflateInit (xsub) |
| 200 | 2 | 1 | 2.43ms | 2.43ms | Compress::Raw::Zlib::CORE:match (opcode) |
| 40 | 1 | 1 | 1.22ms | 1.22ms | Compress::Raw::Zlib::Parameters::new |
| 208 | 2 | 1 | 1.18ms | 1.18ms | Compress::Raw::Zlib::CORE:subst (opcode) |
| 40 | 2 | 1 | 799µs | 799µs | Compress::Raw::Zlib::inflateStream::DESTROY (xsub) |
| 8 | 3 | 2 | 189µs | 248µs | Compress::Raw::Zlib::AUTOLOAD |
| 40 | 1 | 1 | 147µs | 147µs | Compress::Raw::Zlib::inflateStream::inflateReset (xsub) |
| 1 | 1 | 1 | 48µs | 780µs | Compress::Raw::Zlib::BEGIN@6 |
| 1 | 1 | 1 | 42µs | 124µs | Compress::Raw::Zlib::BEGIN@106 |
| 8 | 1 | 1 | 29µs | 29µs | Compress::Raw::Zlib::constant (xsub) |
| 1 | 1 | 1 | 29µs | 101µs | Compress::Raw::Zlib::BEGIN@146 |
| 1 | 1 | 1 | 27µs | 89µs | Compress::Raw::Zlib::BEGIN@113 |
| 1 | 1 | 1 | 26µs | 96µs | Compress::Raw::Zlib::BEGIN@147 |
| 1 | 1 | 1 | 26µs | 101µs | Compress::Raw::Zlib::BEGIN@120 |
| 1 | 1 | 1 | 23µs | 107µs | Compress::Raw::Zlib::BEGIN@137 |
| 1 | 1 | 1 | 23µs | 96µs | Compress::Raw::Zlib::BEGIN@138 |
| 1 | 1 | 1 | 22µs | 654µs | Compress::Raw::Zlib::BEGIN@105 |
| 1 | 1 | 1 | 21µs | 32µs | Compress::Raw::Zlib::BEGIN@9 |
| 1 | 1 | 1 | 20µs | 95µs | Compress::Raw::Zlib::BEGIN@145 |
| 1 | 1 | 1 | 16µs | 84µs | Compress::Raw::Zlib::BEGIN@149 |
| 1 | 1 | 1 | 14µs | 19µs | Compress::Raw::Zlib::BEGIN@8 |
| 1 | 1 | 1 | 14µs | 86µs | Compress::Raw::Zlib::BEGIN@148 |
| 1 | 1 | 1 | 14µs | 84µs | Compress::Raw::Zlib::BEGIN@122 |
| 1 | 1 | 1 | 14µs | 112µs | Compress::Raw::Zlib::BEGIN@118 |
| 1 | 1 | 1 | 14µs | 103µs | Compress::Raw::Zlib::BEGIN@119 |
| 1 | 1 | 1 | 13µs | 113µs | Compress::Raw::Zlib::BEGIN@136 |
| 1 | 1 | 1 | 13µs | 86µs | Compress::Raw::Zlib::BEGIN@121 |
| 1 | 1 | 1 | 12µs | 79µs | Compress::Raw::Zlib::BEGIN@150 |
| 1 | 1 | 1 | 12µs | 93µs | Compress::Raw::Zlib::BEGIN@139 |
| 1 | 1 | 1 | 12µs | 15µs | Compress::Raw::Zlib::BEGIN@10 |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::Deflate::new |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::InflateScan::new |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::Parameters::parsed |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::Parameters::setError |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::deflateStream::STORABLE_freeze |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::deflateStream::STORABLE_thaw |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::deflateStream::deflateParams |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::inflateScanStream::createDeflateStream |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::inflateScanStream::inflate |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::inflateStream::STORABLE_freeze |
| 0 | 0 | 0 | 0s | 0s | Compress::Raw::Zlib::inflateStream::STORABLE_thaw |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | package Compress::Raw::Zlib; | ||||
| 3 | |||||
| 4 | 1 | 26µs | require 5.006 ; | ||
| 5 | 1 | 2µs | require Exporter; | ||
| 6 | 2 | 104µs | 2 | 1.51ms | # spent 780µs (48+732) within Compress::Raw::Zlib::BEGIN@6 which was called:
# once (48µs+732µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 6 # spent 780µs making 1 call to Compress::Raw::Zlib::BEGIN@6
# spent 732µs making 1 call to Exporter::import |
| 7 | |||||
| 8 | 2 | 45µs | 2 | 24µs | # spent 19µs (14+5) within Compress::Raw::Zlib::BEGIN@8 which was called:
# once (14µs+5µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 8 # spent 19µs making 1 call to Compress::Raw::Zlib::BEGIN@8
# spent 5µs making 1 call to strict::import |
| 9 | 2 | 35µs | 2 | 42µs | # spent 32µs (21+10) within Compress::Raw::Zlib::BEGIN@9 which was called:
# once (21µs+10µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 9 # spent 32µs making 1 call to Compress::Raw::Zlib::BEGIN@9
# spent 10µs making 1 call to warnings::import |
| 10 | 2 | 536µs | 2 | 18µs | # spent 15µs (12+3) within Compress::Raw::Zlib::BEGIN@10 which was called:
# once (12µs+3µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 10 # spent 15µs making 1 call to Compress::Raw::Zlib::BEGIN@10
# spent 3µs making 1 call to bytes::import |
| 11 | our ($VERSION, $XS_VERSION, @ISA, @EXPORT, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD, %DEFLATE_CONSTANTS, @DEFLATE_CONSTANTS); | ||||
| 12 | |||||
| 13 | 1 | 1µs | $VERSION = '2.069'; | ||
| 14 | 1 | 900ns | $XS_VERSION = $VERSION; | ||
| 15 | 1 | 24µs | $VERSION = eval $VERSION; # spent 6µs executing statements in string eval | ||
| 16 | |||||
| 17 | 1 | 16µs | @ISA = qw(Exporter); | ||
| 18 | 1 | 10µ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 | |||||
| 52 | 1 | 4µ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. | ||||
| 57 | 1 | 13µ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 | |||||
| 103 | 1 | 2µs | push @EXPORT, qw(crc32 adler32 DEF_WBITS); | ||
| 104 | |||||
| 105 | 2 | 93µs | 2 | 1.29ms | # spent 654µs (22+632) within Compress::Raw::Zlib::BEGIN@105 which was called:
# once (22µs+632µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 105 # spent 654µs making 1 call to Compress::Raw::Zlib::BEGIN@105
# spent 632µs making 1 call to constant::import |
| 106 | 2 | 197µs | 2 | 207µs | # spent 124µs (42+83) within Compress::Raw::Zlib::BEGIN@106 which was called:
# once (42µs+83µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 106 # spent 124µs making 1 call to Compress::Raw::Zlib::BEGIN@106
# spent 83µs making 1 call to constant::import |
| 107 | |||||
| 108 | # spent 248µs (189+59) within Compress::Raw::Zlib::AUTOLOAD which was called 8 times, avg 31µs/call:
# 5 times (120µs+42µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 377, avg 32µs/call
# 2 times (42µs+12µs) by IO::Uncompress::Adapter::Inflate::uncompr at line 66 of IO/Uncompress/Adapter/Inflate.pm, avg 27µs/call
# once (26µs+5µs) by IO::Uncompress::Adapter::Inflate::mkUncompObject at line 42 of IO/Uncompress/Adapter/Inflate.pm | ||||
| 109 | 8 | 6µs | my($constname); | ||
| 110 | 8 | 67µs | 8 | 30µs | ($constname = $AUTOLOAD) =~ s/.*:://; # spent 30µs making 8 calls to Compress::Raw::Zlib::CORE:subst, avg 4µs/call |
| 111 | 8 | 69µs | 8 | 29µs | my ($error, $val) = constant($constname); # spent 29µs making 8 calls to Compress::Raw::Zlib::constant, avg 4µs/call |
| 112 | 8 | 6µs | Carp::croak $error if $error; | ||
| 113 | 2 | 166µs | 2 | 150µs | # spent 89µs (27+61) within Compress::Raw::Zlib::BEGIN@113 which was called:
# once (27µs+61µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 113 # spent 89µs making 1 call to Compress::Raw::Zlib::BEGIN@113
# spent 61µs making 1 call to strict::unimport |
| 114 | 903 | 12.8ms | # spent 4.60ms within Compress::Raw::Zlib::__ANON__[/usr/libdata/perl5/amd64-openbsd/Compress/Raw/Zlib.pm:114] which was called 895 times, avg 5µs/call:
# 503 times (1.90ms+0s) by IO::Uncompress::Adapter::Inflate::uncompr at line 66 of IO/Uncompress/Adapter/Inflate.pm, avg 4µs/call
# 182 times (414µs+0s) by IO::Uncompress::Adapter::Inflate::uncompr at line 72 of IO/Uncompress/Adapter/Inflate.pm, avg 2µs/call
# 41 times (98µs+0s) by IO::Uncompress::Adapter::Inflate::uncompr at line 73 of IO/Uncompress/Adapter/Inflate.pm, avg 2µs/call
# 41 times (89µs+0s) by IO::Uncompress::Adapter::Inflate::uncompr at line 74 of IO/Uncompress/Adapter/Inflate.pm, avg 2µs/call
# 40 times (1.70ms+0s) by IO::Uncompress::Adapter::Inflate::mkUncompObject at line 34 of IO/Uncompress/Adapter/Inflate.pm, avg 42µs/call
# 40 times (157µs+0s) by Compress::Raw::Zlib::Inflate::new at line 465, avg 4µs/call
# 39 times (228µs+0s) by IO::Uncompress::Adapter::Inflate::mkUncompObject at line 42 of IO/Uncompress/Adapter/Inflate.pm, avg 6µs/call
# 8 times (18µs+0s) by IO::Uncompress::Adapter::Inflate::mkUncompObject or IO::Uncompress::Adapter::Inflate::uncompr or IO::Uncompress::RawInflate::BEGIN@8 at line 115, avg 2µs/call
# once (2µs+0s) by IO::Uncompress::RawInflate::BEGIN@8 at line 434 | ||
| 115 | 8 | 59µs | 8 | 18µs | goto &{$AUTOLOAD}; # spent 18µs making 8 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:114], avg 2µs/call |
| 116 | } | ||||
| 117 | |||||
| 118 | 2 | 60µs | 2 | 210µs | # spent 112µs (14+98) within Compress::Raw::Zlib::BEGIN@118 which was called:
# once (14µs+98µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 118 # spent 112µs making 1 call to Compress::Raw::Zlib::BEGIN@118
# spent 98µs making 1 call to constant::import |
| 119 | 2 | 62µs | 2 | 193µs | # spent 103µs (14+90) within Compress::Raw::Zlib::BEGIN@119 which was called:
# once (14µs+90µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 119 # spent 103µs making 1 call to Compress::Raw::Zlib::BEGIN@119
# spent 90µs making 1 call to constant::import |
| 120 | 2 | 44µs | 2 | 176µs | # spent 101µs (26+75) within Compress::Raw::Zlib::BEGIN@120 which was called:
# once (26µs+75µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 120 # spent 101µs making 1 call to Compress::Raw::Zlib::BEGIN@120
# spent 75µs making 1 call to constant::import |
| 121 | 2 | 76µs | 2 | 159µs | # spent 86µs (13+73) within Compress::Raw::Zlib::BEGIN@121 which was called:
# once (13µs+73µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 121 # spent 86µs making 1 call to Compress::Raw::Zlib::BEGIN@121
# spent 73µs making 1 call to constant::import |
| 122 | 2 | 127µs | 2 | 155µs | # spent 84µs (14+70) within Compress::Raw::Zlib::BEGIN@122 which was called:
# once (14µs+70µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 122 # spent 84µs making 1 call to Compress::Raw::Zlib::BEGIN@122
# spent 70µs making 1 call to constant::import |
| 123 | |||||
| 124 | eval { | ||||
| 125 | 1 | 1µs | require XSLoader; | ||
| 126 | 1 | 715µs | 1 | 695µs | XSLoader::load('Compress::Raw::Zlib', $XS_VERSION); # spent 695µs making 1 call to XSLoader::load |
| 127 | 1 | 2µs | 1; | ||
| 128 | } | ||||
| 129 | 1 | 2µs | or do { | ||
| 130 | require DynaLoader; | ||||
| 131 | local @ISA = qw(DynaLoader); | ||||
| 132 | bootstrap Compress::Raw::Zlib $XS_VERSION ; | ||||
| 133 | }; | ||||
| 134 | |||||
| 135 | |||||
| 136 | 2 | 111µs | 2 | 214µs | # spent 113µs (13+100) within Compress::Raw::Zlib::BEGIN@136 which was called:
# once (13µs+100µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 136 # spent 113µs making 1 call to Compress::Raw::Zlib::BEGIN@136
# spent 100µs making 1 call to constant::import |
| 137 | 2 | 55µs | 2 | 191µs | # spent 107µs (23+84) within Compress::Raw::Zlib::BEGIN@137 which was called:
# once (23µs+84µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 137 # spent 107µs making 1 call to Compress::Raw::Zlib::BEGIN@137
# spent 84µs making 1 call to constant::import |
| 138 | 2 | 45µs | 2 | 170µs | # spent 96µs (23+73) within Compress::Raw::Zlib::BEGIN@138 which was called:
# once (23µs+73µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 138 # spent 96µs making 1 call to Compress::Raw::Zlib::BEGIN@138
# spent 73µs making 1 call to constant::import |
| 139 | 2 | 46µs | 2 | 175µs | # spent 93µs (12+81) within Compress::Raw::Zlib::BEGIN@139 which was called:
# once (12µs+81µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 139 # spent 93µs making 1 call to Compress::Raw::Zlib::BEGIN@139
# spent 81µ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 | |||||
| 145 | 2 | 74µs | 2 | 170µs | # spent 95µs (20+75) within Compress::Raw::Zlib::BEGIN@145 which was called:
# once (20µs+75µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 145 # spent 95µs making 1 call to Compress::Raw::Zlib::BEGIN@145
# spent 75µs making 1 call to constant::import |
| 146 | 2 | 60µs | 2 | 173µs | # spent 101µs (29+72) within Compress::Raw::Zlib::BEGIN@146 which was called:
# once (29µs+72µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 146 # spent 101µs making 1 call to Compress::Raw::Zlib::BEGIN@146
# spent 72µs making 1 call to constant::import |
| 147 | 2 | 41µs | 2 | 166µs | # spent 96µs (26+70) within Compress::Raw::Zlib::BEGIN@147 which was called:
# once (26µs+70µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 147 # spent 96µs making 1 call to Compress::Raw::Zlib::BEGIN@147
# spent 70µs making 1 call to constant::import |
| 148 | 2 | 45µs | 2 | 159µs | # spent 86µs (14+72) within Compress::Raw::Zlib::BEGIN@148 which was called:
# once (14µs+72µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 148 # spent 86µs making 1 call to Compress::Raw::Zlib::BEGIN@148
# spent 72µs making 1 call to constant::import |
| 149 | 2 | 46µs | 2 | 152µs | # spent 84µs (16+68) within Compress::Raw::Zlib::BEGIN@149 which was called:
# once (16µs+68µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 149 # spent 84µs making 1 call to Compress::Raw::Zlib::BEGIN@149
# spent 68µs making 1 call to constant::import |
| 150 | 2 | 3.39ms | 2 | 147µs | # spent 79µs (12+67) within Compress::Raw::Zlib::BEGIN@150 which was called:
# once (12µs+67µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 150 # spent 79µs making 1 call to Compress::Raw::Zlib::BEGIN@150
# spent 67µs making 1 call to constant::import |
| 151 | |||||
| - - | |||||
| 154 | sub ParseParameters | ||||
| 155 | # spent 44.9ms (4.19+40.7) within Compress::Raw::Zlib::ParseParameters which was called 40 times, avg 1.12ms/call:
# 40 times (4.19ms+40.7ms) by Compress::Raw::Zlib::Inflate::new at line 450, avg 1.12ms/call | ||||
| 156 | 40 | 51µs | my $level = shift || 0 ; | ||
| 157 | |||||
| 158 | 40 | 2.18ms | my $sub = (caller($level + 1))[3] ; | ||
| 159 | #local $Carp::CarpLevel = 1 ; | ||||
| 160 | 40 | 664µs | 40 | 1.22ms | my $p = new Compress::Raw::Zlib::Parameters() ; # spent 1.22ms making 40 calls to Compress::Raw::Zlib::Parameters::new, avg 31µs/call |
| 161 | 40 | 628µs | 40 | 39.5ms | $p->parse(@_) # spent 39.5ms making 40 calls to Compress::Raw::Zlib::Parameters::parse, avg 986µs/call |
| 162 | or croak "$sub: $p->{Error}" ; | ||||
| 163 | |||||
| 164 | 40 | 215µs | return $p; | ||
| 165 | } | ||||
| 166 | |||||
| 167 | |||||
| 168 | sub Compress::Raw::Zlib::Parameters::new | ||||
| 169 | # spent 1.22ms within Compress::Raw::Zlib::Parameters::new which was called 40 times, avg 31µs/call:
# 40 times (1.22ms+0s) by Compress::Raw::Zlib::ParseParameters at line 160, avg 31µs/call | ||||
| 170 | 40 | 55µs | my $class = shift ; | ||
| 171 | |||||
| 172 | 40 | 998µs | my $obj = { Error => '', | ||
| 173 | Got => {}, | ||||
| 174 | } ; | ||||
| 175 | |||||
| 176 | #return bless $obj, ref($class) || $class || __PACKAGE__ ; | ||||
| 177 | 40 | 271µs | return bless $obj, 'Compress::Raw::Zlib::Parameters' ; | ||
| 178 | } | ||||
| 179 | |||||
| 180 | sub 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 | |||||
| 196 | sub Compress::Raw::Zlib::Parameters::parse | ||||
| 197 | # spent 39.5ms (28.3+11.2) within Compress::Raw::Zlib::Parameters::parse which was called 40 times, avg 986µs/call:
# 40 times (28.3ms+11.2ms) by Compress::Raw::Zlib::ParseParameters at line 161, avg 986µs/call | ||||
| 198 | 40 | 51µs | my $self = shift ; | ||
| 199 | |||||
| 200 | 40 | 43µs | my $default = shift ; | ||
| 201 | |||||
| 202 | 40 | 67µs | my $got = $self->{Got} ; | ||
| 203 | 40 | 112µs | my $firstTime = keys %{ $got } == 0 ; | ||
| 204 | |||||
| 205 | 40 | 39µs | my (@Bad) ; | ||
| 206 | 40 | 70µs | my @entered = () ; | ||
| 207 | |||||
| 208 | # Allow the options to be passed as a hash reference or | ||||
| 209 | # as the complete hash. | ||||
| 210 | 40 | 126µ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 { | ||||
| 224 | 40 | 486µs | my $count = @_; | ||
| 225 | 40 | 66µs | return $self->setError("Expected even number of parameters, got $count") | ||
| 226 | if $count % 2 != 0 ; | ||||
| 227 | |||||
| 228 | 40 | 570µs | for my $i (0.. $count / 2 - 1) { | ||
| 229 | 200 | 1.28ms | push @entered, $_[2* $i] ; | ||
| 230 | 200 | 534µs | push @entered, \$_[2* $i+1] ; | ||
| 231 | } | ||||
| 232 | } | ||||
| 233 | |||||
| 234 | |||||
| 235 | 40 | 2.86ms | while (my ($key, $v) = each %$default) | ||
| 236 | { | ||||
| 237 | 320 | 281µs | croak "need 4 params [@$v]" | ||
| 238 | if @$v != 4 ; | ||||
| 239 | |||||
| 240 | 320 | 797µs | my ($first_only, $sticky, $type, $value) = @$v ; | ||
| 241 | 320 | 249µs | my $x ; | ||
| 242 | 320 | 1.68ms | 320 | 4.43ms | $self->_checkType($key, \$value, $type, 0, \$x) # spent 4.43ms making 320 calls to Compress::Raw::Zlib::Parameters::_checkType, avg 14µs/call |
| 243 | or return undef ; | ||||
| 244 | |||||
| 245 | 320 | 493µs | $key = lc $key; | ||
| 246 | |||||
| 247 | 320 | 3.33ms | if ($firstTime || ! $sticky) { | ||
| 248 | $got->{$key} = [0, $type, $value, $x, $first_only, $sticky] ; | ||||
| 249 | } | ||||
| 250 | |||||
| 251 | 320 | 429µs | $got->{$key}[OFF_PARSED] = 0 ; | ||
| 252 | } | ||||
| 253 | |||||
| 254 | 40 | 170µs | for my $i (0.. @entered / 2 - 1) { | ||
| 255 | 200 | 243µs | my $key = $entered[2* $i] ; | ||
| 256 | 200 | 207µs | my $value = $entered[2* $i+1] ; | ||
| 257 | |||||
| 258 | #print "Key [$key] Value [$value]" ; | ||||
| 259 | #print defined $$value ? "[$$value]\n" : "[undef]\n"; | ||||
| 260 | |||||
| 261 | 200 | 2.40ms | 200 | 1.15ms | $key =~ s/^-// ; # spent 1.15ms making 200 calls to Compress::Raw::Zlib::CORE:subst, avg 6µs/call |
| 262 | 200 | 285µs | my $canonkey = lc $key; | ||
| 263 | |||||
| 264 | 200 | 873µs | if ($got->{$canonkey} && ($firstTime || | ||
| 265 | ! $got->{$canonkey}[OFF_FIRST_ONLY] )) | ||||
| 266 | { | ||||
| 267 | 200 | 229µs | my $type = $got->{$canonkey}[OFF_TYPE] ; | ||
| 268 | 200 | 157µs | my $s ; | ||
| 269 | 200 | 779µs | 200 | 5.58ms | $self->_checkType($key, $value, $type, 1, \$s) # spent 5.58ms making 200 calls to Compress::Raw::Zlib::Parameters::_checkType, avg 28µs/call |
| 270 | or return undef ; | ||||
| 271 | #$value = $$value unless $type & Parse_store_ref ; | ||||
| 272 | 200 | 185µs | $value = $$value ; | ||
| 273 | 200 | 592µs | $got->{$canonkey} = [1, $type, $value, $s] ; | ||
| 274 | } | ||||
| 275 | else | ||||
| 276 | { push (@Bad, $key) } | ||||
| 277 | } | ||||
| 278 | |||||
| 279 | 40 | 53µs | if (@Bad) { | ||
| 280 | my ($bad) = join(", ", @Bad) ; | ||||
| 281 | return $self->setError("unknown key value(s) @Bad") ; | ||||
| 282 | } | ||||
| 283 | |||||
| 284 | 40 | 256µs | return 1; | ||
| 285 | } | ||||
| 286 | |||||
| 287 | sub Compress::Raw::Zlib::Parameters::_checkType | ||||
| 288 | # spent 10.0ms (7.59+2.43) within Compress::Raw::Zlib::Parameters::_checkType which was called 520 times, avg 19µs/call:
# 320 times (4.43ms+0s) by Compress::Raw::Zlib::Parameters::parse at line 242, avg 14µs/call
# 200 times (3.15ms+2.43ms) by Compress::Raw::Zlib::Parameters::parse at line 269, avg 28µs/call | ||||
| 289 | 520 | 457µs | my $self = shift ; | ||
| 290 | |||||
| 291 | 520 | 464µs | my $key = shift ; | ||
| 292 | 520 | 458µs | my $value = shift ; | ||
| 293 | 520 | 429µs | my $type = shift ; | ||
| 294 | 520 | 420µs | my $validate = shift ; | ||
| 295 | 520 | 423µ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 | |||||
| 308 | 520 | 491µs | $value = $$value ; | ||
| 309 | |||||
| 310 | 520 | 652µs | if ($type & Parse_any) | ||
| 311 | { | ||||
| 312 | 40 | 42µs | $$output = $value ; | ||
| 313 | 40 | 199µs | return 1; | ||
| 314 | } | ||||
| 315 | elsif ($type & Parse_unsigned) | ||||
| 316 | { | ||||
| 317 | 40 | 40µs | return $self->setError("Parameter '$key' must be an unsigned int, got 'undef'") | ||
| 318 | if $validate && ! defined $value ; | ||||
| 319 | 40 | 39µs | return $self->setError("Parameter '$key' must be an unsigned int, got '$value'") | ||
| 320 | if $validate && $value !~ /^\d+$/; | ||||
| 321 | |||||
| 322 | 40 | 47µs | $$output = defined $value ? $value : 0 ; | ||
| 323 | 40 | 186µs | return 1; | ||
| 324 | } | ||||
| 325 | elsif ($type & Parse_signed) | ||||
| 326 | { | ||||
| 327 | 80 | 84µs | return $self->setError("Parameter '$key' must be a signed int, got 'undef'") | ||
| 328 | if $validate && ! defined $value ; | ||||
| 329 | 80 | 953µs | 40 | 739µs | return $self->setError("Parameter '$key' must be a signed int, got '$value'") # spent 739µs making 40 calls to Compress::Raw::Zlib::CORE:match, avg 18µs/call |
| 330 | if $validate && $value !~ /^-?\d+$/; | ||||
| 331 | |||||
| 332 | 80 | 92µs | $$output = defined $value ? $value : 0 ; | ||
| 333 | 80 | 403µs | return 1 ; | ||
| 334 | } | ||||
| 335 | elsif ($type & Parse_boolean) | ||||
| 336 | { | ||||
| 337 | 360 | 2.54ms | 160 | 1.69ms | return $self->setError("Parameter '$key' must be an int, got '$value'") # spent 1.69ms making 160 calls to Compress::Raw::Zlib::CORE:match, avg 11µs/call |
| 338 | if $validate && defined $value && $value !~ /^\d*$/; | ||||
| 339 | 360 | 400µs | $$output = defined $value ? $value != 0 : 0 ; | ||
| 340 | 360 | 10.3ms | 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 | |||||
| - - | |||||
| 354 | sub 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 | |||||
| 362 | sub Compress::Raw::Zlib::Parameters::value | ||||
| 363 | # spent 3.63ms within Compress::Raw::Zlib::Parameters::value which was called 360 times, avg 10µs/call:
# 80 times (464µs+0s) by Compress::Raw::Zlib::Inflate::new at line 468, avg 6µs/call
# 40 times (1.21ms+0s) by Compress::Raw::Zlib::Inflate::new at line 461, avg 30µs/call
# 40 times (806µs+0s) by Compress::Raw::Zlib::Inflate::new at line 452, avg 20µs/call
# 40 times (239µs+0s) by Compress::Raw::Zlib::Inflate::new at line 458, avg 6µs/call
# 40 times (237µs+0s) by Compress::Raw::Zlib::Inflate::new at line 457, avg 6µs/call
# 40 times (230µs+0s) by Compress::Raw::Zlib::Inflate::new at line 464, avg 6µs/call
# 40 times (228µs+0s) by Compress::Raw::Zlib::Inflate::new at line 460, avg 6µs/call
# 40 times (218µs+0s) by Compress::Raw::Zlib::Inflate::new at line 459, avg 5µs/call | ||||
| 364 | 360 | 319µs | my $self = shift ; | ||
| 365 | 360 | 1.31ms | my $name = shift ; | ||
| 366 | |||||
| 367 | 360 | 299µ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 | |||||
| 374 | 360 | 1.93ms | return $self->{Got}{lc $name}[OFF_FIXED] ; | ||
| 375 | } | ||||
| 376 | |||||
| 377 | 1 | 45µs | 5 | 162µs | our $OPTIONS_deflate = # spent 162µs making 5 calls to Compress::Raw::Zlib::AUTOLOAD, avg 32µ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 | |||||
| 392 | sub 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 | |||||
| 421 | sub Compress::Raw::Zlib::deflateStream::STORABLE_freeze | ||||
| 422 | { | ||||
| 423 | my $type = ref shift; | ||||
| 424 | croak "Cannot freeze $type object\n"; | ||||
| 425 | } | ||||
| 426 | |||||
| 427 | sub Compress::Raw::Zlib::deflateStream::STORABLE_thaw | ||||
| 428 | { | ||||
| 429 | my $type = ref shift; | ||||
| 430 | croak "Cannot thaw $type object\n"; | ||||
| 431 | } | ||||
| 432 | |||||
| 433 | |||||
| 434 | 1 | 11µs | 1 | 2µs | our $OPTIONS_inflate = # spent 2µs making 1 call to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:114] |
| 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 | |||||
| 447 | sub Compress::Raw::Zlib::Inflate::new | ||||
| 448 | # spent 66.5ms (15.1+51.5) within Compress::Raw::Zlib::Inflate::new which was called 40 times, avg 1.66ms/call:
# 40 times (15.1ms+51.5ms) by IO::Uncompress::Adapter::Inflate::mkUncompObject at line 34 of IO/Uncompress/Adapter/Inflate.pm, avg 1.66ms/call | ||||
| 449 | 40 | 56µs | my $pkg = shift ; | ||
| 450 | 40 | 1.15ms | 40 | 44.9ms | my ($got) = ParseParameters(0, $OPTIONS_inflate, @_); # spent 44.9ms making 40 calls to Compress::Raw::Zlib::ParseParameters, avg 1.12ms/call |
| 451 | |||||
| 452 | 40 | 655µs | 40 | 806µs | croak "Compress::Raw::Zlib::Inflate::new: Bufsize must be >= 1, you specified " . # spent 806µs making 40 calls to Compress::Raw::Zlib::Parameters::value, avg 20µs/call |
| 453 | $got->value('Bufsize') | ||||
| 454 | unless $got->value('Bufsize') >= 1; | ||||
| 455 | |||||
| 456 | 40 | 49µs | my $flags = 0 ; | ||
| 457 | 40 | 188µs | 40 | 237µs | $flags |= FLAG_APPEND if $got->value('AppendOutput') ; # spent 237µs making 40 calls to Compress::Raw::Zlib::Parameters::value, avg 6µs/call |
| 458 | 40 | 168µs | 40 | 239µs | $flags |= FLAG_CRC if $got->value('CRC32') ; # spent 239µs making 40 calls to Compress::Raw::Zlib::Parameters::value, avg 6µs/call |
| 459 | 40 | 160µs | 40 | 218µs | $flags |= FLAG_ADLER if $got->value('ADLER32') ; # spent 218µs making 40 calls to Compress::Raw::Zlib::Parameters::value, avg 5µs/call |
| 460 | 40 | 157µs | 40 | 228µs | $flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ; # spent 228µs making 40 calls to Compress::Raw::Zlib::Parameters::value, avg 6µs/call |
| 461 | 40 | 171µs | 40 | 1.21ms | $flags |= FLAG_LIMIT_OUTPUT if $got->value('LimitOutput') ; # spent 1.21ms making 40 calls to Compress::Raw::Zlib::Parameters::value, avg 30µs/call |
| 462 | |||||
| 463 | |||||
| 464 | 40 | 204µs | 40 | 230µs | my $windowBits = $got->value('WindowBits'); # spent 230µs making 40 calls to Compress::Raw::Zlib::Parameters::value, avg 6µs/call |
| 465 | 40 | 231µs | 40 | 157µs | $windowBits += MAX_WBITS() # spent 157µs making 40 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:114], avg 4µs/call |
| 466 | if ($windowBits & MAX_WBITS()) == 0 ; | ||||
| 467 | |||||
| 468 | 40 | 4.05ms | 120 | 3.29ms | _inflateInit($flags, $windowBits, $got->value('Bufsize'), # spent 2.82ms making 40 calls to Compress::Raw::Zlib::_inflateInit, avg 71µs/call
# spent 464µs making 80 calls to Compress::Raw::Zlib::Parameters::value, avg 6µs/call |
| 469 | $got->value('Dictionary')) ; | ||||
| 470 | } | ||||
| 471 | |||||
| 472 | sub Compress::Raw::Zlib::inflateStream::STORABLE_freeze | ||||
| 473 | { | ||||
| 474 | my $type = ref shift; | ||||
| 475 | croak "Cannot freeze $type object\n"; | ||||
| 476 | } | ||||
| 477 | |||||
| 478 | sub Compress::Raw::Zlib::inflateStream::STORABLE_thaw | ||||
| 479 | { | ||||
| 480 | my $type = ref shift; | ||||
| 481 | croak "Cannot thaw $type object\n"; | ||||
| 482 | } | ||||
| 483 | |||||
| 484 | sub 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 | |||||
| 512 | sub 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 | |||||
| 549 | sub 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 | |||||
| 566 | sub 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 | |||||
| 595 | 1 | 41µs | 1; | ||
| 596 | __END__ | ||||
sub Compress::Raw::Zlib::CORE:match; # opcode | |||||
sub Compress::Raw::Zlib::CORE:subst; # opcode | |||||
# spent 2.82ms within Compress::Raw::Zlib::_inflateInit which was called 40 times, avg 71µs/call:
# 40 times (2.82ms+0s) by Compress::Raw::Zlib::Inflate::new at line 468, avg 71µs/call | |||||
# spent 29µs within Compress::Raw::Zlib::constant which was called 8 times, avg 4µs/call:
# 8 times (29µs+0s) by Compress::Raw::Zlib::AUTOLOAD at line 111, avg 4µs/call | |||||
# spent 799µs within Compress::Raw::Zlib::inflateStream::DESTROY which was called 40 times, avg 20µs/call:
# 39 times (795µs+0s) by OpenBSD::PackageLocation::deref at line 285 of OpenBSD/PackageLocation.pm, avg 20µs/call
# once (4µs+0s) by OpenBSD::PackageLocation::deref at line 284 of OpenBSD/PackageLocation.pm | |||||
# spent 13.2ms within Compress::Raw::Zlib::inflateStream::inflate which was called 182 times, avg 72µs/call:
# 182 times (13.2ms+0s) by IO::Uncompress::Adapter::Inflate::uncompr at line 63 of IO/Uncompress/Adapter/Inflate.pm, avg 72µs/call | |||||
# spent 147µs within Compress::Raw::Zlib::inflateStream::inflateReset which was called 40 times, avg 4µs/call:
# 40 times (147µs+0s) by IO::Uncompress::Adapter::Inflate::reset at line 81 of IO/Uncompress/Adapter/Inflate.pm, avg 4µs/call |