| Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/IO/Compress/Adapter/Deflate.pm |
| Statements | Executed 20 statements in 487µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1.72ms | 2.56ms | IO::Compress::Adapter::Deflate::BEGIN@8 |
| 1 | 1 | 1 | 8µs | 10µs | IO::Compress::Adapter::Deflate::BEGIN@3 |
| 1 | 1 | 1 | 6µs | 63µs | IO::Compress::Adapter::Deflate::BEGIN@7 |
| 1 | 1 | 1 | 6µs | 6µs | IO::Compress::Adapter::Deflate::BEGIN@5 |
| 1 | 1 | 1 | 4µs | 7µs | IO::Compress::Adapter::Deflate::BEGIN@4 |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Deflate::adler32 |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Deflate::close |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Deflate::compr |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Deflate::compressedBytes |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Deflate::crc32 |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Deflate::deflateParams |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Deflate::flush |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Deflate::mkCompObject |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Deflate::reset |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Deflate::uncompressedBytes |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package IO::Compress::Adapter::Deflate ; | ||||
| 2 | |||||
| 3 | 2 | 13µs | 2 | 11µs | # spent 10µs (8+2) within IO::Compress::Adapter::Deflate::BEGIN@3 which was called:
# once (8µs+2µs) by IO::Compress::RawDeflate::BEGIN@11 at line 3 # spent 10µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@3
# spent 2µs making 1 call to strict::import |
| 4 | 2 | 12µs | 2 | 11µs | # spent 7µs (4+3) within IO::Compress::Adapter::Deflate::BEGIN@4 which was called:
# once (4µs+3µs) by IO::Compress::RawDeflate::BEGIN@11 at line 4 # spent 7µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@4
# spent 3µs making 1 call to warnings::import |
| 5 | 2 | 16µs | 2 | 7µs | # spent 6µs (6+700ns) within IO::Compress::Adapter::Deflate::BEGIN@5 which was called:
# once (6µs+700ns) by IO::Compress::RawDeflate::BEGIN@11 at line 5 # spent 6µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@5
# spent 700ns making 1 call to bytes::import |
| 6 | |||||
| 7 | 3 | 27µs | 3 | 120µs | # spent 63µs (6+56) within IO::Compress::Adapter::Deflate::BEGIN@7 which was called:
# once (6µs+56µs) by IO::Compress::RawDeflate::BEGIN@11 at line 7 # spent 63µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@7
# spent 52µs making 1 call to Exporter::import
# spent 5µs making 1 call to UNIVERSAL::VERSION |
| 8 | 3 | 405µs | 3 | 2.78ms | # spent 2.56ms (1.72+842µs) within IO::Compress::Adapter::Deflate::BEGIN@8 which was called:
# once (1.72ms+842µs) by IO::Compress::RawDeflate::BEGIN@11 at line 8 # spent 2.56ms making 1 call to IO::Compress::Adapter::Deflate::BEGIN@8
# spent 215µs making 1 call to Exporter::import
# spent 6µs making 1 call to UNIVERSAL::VERSION |
| 9 | |||||
| 10 | 1 | 400ns | require Exporter; | ||
| 11 | our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, @EXPORT, %DEFLATE_CONSTANTS); | ||||
| 12 | |||||
| 13 | 1 | 200ns | $VERSION = '2.068'; | ||
| 14 | 1 | 4µs | @ISA = qw(Exporter); | ||
| 15 | 1 | 2µs | @EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS; | ||
| 16 | 1 | 2µs | %EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS; | ||
| 17 | 1 | 1µs | @EXPORT = @EXPORT_OK; | ||
| 18 | 1 | 700ns | %DEFLATE_CONSTANTS = %EXPORT_TAGS ; | ||
| 19 | |||||
| 20 | sub mkCompObject | ||||
| 21 | { | ||||
| 22 | my $crc32 = shift ; | ||||
| 23 | my $adler32 = shift ; | ||||
| 24 | my $level = shift ; | ||||
| 25 | my $strategy = shift ; | ||||
| 26 | |||||
| 27 | my ($def, $status) = new Compress::Raw::Zlib::Deflate | ||||
| 28 | -AppendOutput => 1, | ||||
| 29 | -CRC32 => $crc32, | ||||
| 30 | -ADLER32 => $adler32, | ||||
| 31 | -Level => $level, | ||||
| 32 | -Strategy => $strategy, | ||||
| 33 | -WindowBits => - MAX_WBITS; | ||||
| 34 | |||||
| 35 | return (undef, "Cannot create Deflate object: $status", $status) | ||||
| 36 | if $status != Z_OK; | ||||
| 37 | |||||
| 38 | return bless {'Def' => $def, | ||||
| 39 | 'Error' => '', | ||||
| 40 | } ; | ||||
| 41 | } | ||||
| 42 | |||||
| 43 | sub compr | ||||
| 44 | { | ||||
| 45 | my $self = shift ; | ||||
| 46 | |||||
| 47 | my $def = $self->{Def}; | ||||
| 48 | |||||
| 49 | my $status = $def->deflate($_[0], $_[1]) ; | ||||
| 50 | $self->{ErrorNo} = $status; | ||||
| 51 | |||||
| 52 | if ($status != Z_OK) | ||||
| 53 | { | ||||
| 54 | $self->{Error} = "Deflate Error: $status"; | ||||
| 55 | return STATUS_ERROR; | ||||
| 56 | } | ||||
| 57 | |||||
| 58 | return STATUS_OK; | ||||
| 59 | } | ||||
| 60 | |||||
| 61 | sub flush | ||||
| 62 | { | ||||
| 63 | my $self = shift ; | ||||
| 64 | |||||
| 65 | my $def = $self->{Def}; | ||||
| 66 | |||||
| 67 | my $opt = $_[1] || Z_FINISH; | ||||
| 68 | my $status = $def->flush($_[0], $opt); | ||||
| 69 | $self->{ErrorNo} = $status; | ||||
| 70 | |||||
| 71 | if ($status != Z_OK) | ||||
| 72 | { | ||||
| 73 | $self->{Error} = "Deflate Error: $status"; | ||||
| 74 | return STATUS_ERROR; | ||||
| 75 | } | ||||
| 76 | |||||
| 77 | return STATUS_OK; | ||||
| 78 | } | ||||
| 79 | |||||
| 80 | sub close | ||||
| 81 | { | ||||
| 82 | my $self = shift ; | ||||
| 83 | |||||
| 84 | my $def = $self->{Def}; | ||||
| 85 | |||||
| 86 | $def->flush($_[0], Z_FINISH) | ||||
| 87 | if defined $def ; | ||||
| 88 | } | ||||
| 89 | |||||
| 90 | sub reset | ||||
| 91 | { | ||||
| 92 | my $self = shift ; | ||||
| 93 | |||||
| 94 | my $def = $self->{Def}; | ||||
| 95 | |||||
| 96 | my $status = $def->deflateReset() ; | ||||
| 97 | $self->{ErrorNo} = $status; | ||||
| 98 | if ($status != Z_OK) | ||||
| 99 | { | ||||
| 100 | $self->{Error} = "Deflate Error: $status"; | ||||
| 101 | return STATUS_ERROR; | ||||
| 102 | } | ||||
| 103 | |||||
| 104 | return STATUS_OK; | ||||
| 105 | } | ||||
| 106 | |||||
| 107 | sub deflateParams | ||||
| 108 | { | ||||
| 109 | my $self = shift ; | ||||
| 110 | |||||
| 111 | my $def = $self->{Def}; | ||||
| 112 | |||||
| 113 | my $status = $def->deflateParams(@_); | ||||
| 114 | $self->{ErrorNo} = $status; | ||||
| 115 | if ($status != Z_OK) | ||||
| 116 | { | ||||
| 117 | $self->{Error} = "deflateParams Error: $status"; | ||||
| 118 | return STATUS_ERROR; | ||||
| 119 | } | ||||
| 120 | |||||
| 121 | return STATUS_OK; | ||||
| 122 | } | ||||
| 123 | |||||
| - - | |||||
| 126 | #sub total_out | ||||
| 127 | #{ | ||||
| 128 | # my $self = shift ; | ||||
| 129 | # $self->{Def}->total_out(); | ||||
| 130 | #} | ||||
| 131 | # | ||||
| 132 | #sub total_in | ||||
| 133 | #{ | ||||
| 134 | # my $self = shift ; | ||||
| 135 | # $self->{Def}->total_in(); | ||||
| 136 | #} | ||||
| 137 | |||||
| 138 | sub compressedBytes | ||||
| 139 | { | ||||
| 140 | my $self = shift ; | ||||
| 141 | |||||
| 142 | $self->{Def}->compressedBytes(); | ||||
| 143 | } | ||||
| 144 | |||||
| 145 | sub uncompressedBytes | ||||
| 146 | { | ||||
| 147 | my $self = shift ; | ||||
| 148 | $self->{Def}->uncompressedBytes(); | ||||
| 149 | } | ||||
| 150 | |||||
| - - | |||||
| 154 | sub crc32 | ||||
| 155 | { | ||||
| 156 | my $self = shift ; | ||||
| 157 | $self->{Def}->crc32(); | ||||
| 158 | } | ||||
| 159 | |||||
| 160 | sub adler32 | ||||
| 161 | { | ||||
| 162 | my $self = shift ; | ||||
| 163 | $self->{Def}->adler32(); | ||||
| 164 | } | ||||
| 165 | |||||
| 166 | |||||
| 167 | 1 | 4µs | 1; | ||
| 168 | |||||
| 169 | __END__ |