Profile of /usr/local/lib/perl5/5.10.1/darwin-2level/IO/Uncompress/Adapter/Inflate.pm

← Index
NYTProf Performance Profile «block view•line view•sub view»
For 01.HTTP.t
Run on Tue May 4 15:25:55 2010
Reported on Tue May 4 15:26:05 2010

File | /usr/local/lib/perl5/5.10.1/darwin-2level/IO/Uncompress/Adapter/Inflate.pm
Statements Executed | 18
Statement Execution Time | 11.3ms

Subroutines — ordered by exclusive time
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 16µs | 20µs | IO::Uncompress::Adapter::Inflate::::BEGIN@3IO::Uncompress::Adapter::Inflate::BEGIN@3
1 | 1 | 1 | 15µs | 167µs | IO::Uncompress::Adapter::Inflate::::BEGIN@8IO::Uncompress::Adapter::Inflate::BEGIN@8
1 | 1 | 1 | 11µs | 149µs | IO::Uncompress::Adapter::Inflate::::BEGIN@7IO::Uncompress::Adapter::Inflate::BEGIN@7
1 | 1 | 1 | 8µs | 21µs | IO::Uncompress::Adapter::Inflate::::BEGIN@4IO::Uncompress::Adapter::Inflate::BEGIN@4
1 | 1 | 1 | 7µs | 10µs | IO::Uncompress::Adapter::Inflate::::BEGIN@5IO::Uncompress::Adapter::Inflate::BEGIN@5
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::adler32IO::Uncompress::Adapter::Inflate::adler32
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::compressedBytesIO::Uncompress::Adapter::Inflate::compressedBytes
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::crc32IO::Uncompress::Adapter::Inflate::crc32
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::createDeflateStreamIO::Uncompress::Adapter::Inflate::createDeflateStream
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::getEndOffsetIO::Uncompress::Adapter::Inflate::getEndOffset
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::getLastBlockOffsetIO::Uncompress::Adapter::Inflate::getLastBlockOffset
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::mkUncompObjectIO::Uncompress::Adapter::Inflate::mkUncompObject
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::resetIO::Uncompress::Adapter::Inflate::reset
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::resetLastBlockByteIO::Uncompress::Adapter::Inflate::resetLastBlockByte
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::syncIO::Uncompress::Adapter::Inflate::sync
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::uncomprIO::Uncompress::Adapter::Inflate::uncompr
0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::::uncompressedBytesIO::Uncompress::Adapter::Inflate::uncompressedBytes

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package IO::Uncompress::Adapter::Inflate;
2 |  |  |  |  |
3 | 3 | 23µs | 2 | 23µs | # spent 20µs (16+4) within IO::Uncompress::Adapter::Inflate::BEGIN@3 which was called # once (16µs+4µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 3 use strict; # spent 20µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@3 # spent 4µs making 1 call to strict::import
4 | 3 | 20µs | 2 | 33µs | # spent 21µs (8+12) within IO::Uncompress::Adapter::Inflate::BEGIN@4 which was called # once (8µs+12µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 4 use warnings; # spent 21µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@4 # spent 12µs making 1 call to warnings::import
5 | 3 | 24µs | 2 | 12µs | # spent 10µs (7+2) within IO::Uncompress::Adapter::Inflate::BEGIN@5 which was called # once (7µs+2µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 5 use bytes; # spent 10µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@5 # spent 2µs making 1 call to bytes::import
6 |  |  |  |  |
7 | 3 | 52µs | 3 | 286µs | # spent 149µs (11+137) within IO::Uncompress::Adapter::Inflate::BEGIN@7 which was called # once (11µs+137µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 7 use IO::Compress::Base::Common 2.020 qw(:Status); # spent 149µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@7 # spent 124µs making 1 call to Exporter::import # spent 13µs making 1 call to UNIVERSAL::VERSION
8 | 3 | 11.2ms | 3 | 320µs | # spent 167µs (15+152) within IO::Uncompress::Adapter::Inflate::BEGIN@8 which was called # once (15µs+152µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 8 use Compress::Raw::Zlib 2.020 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); # spent 167µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@8 # spent 136µs making 1 call to Exporter::import # spent 16µs making 1 call to UNIVERSAL::VERSION
9 |  |  |  |  |
10 | 1 | 300ns |  |  | our ($VERSION);
11 | 1 | 3µs |  |  | $VERSION = '2.020';
12 |  |  |  |  |
13 |  |  |  |  |
14 |  |  |  |  |
15 |  |  |  |  | sub mkUncompObject
16 |  |  |  |  | {
17 |  |  |  |  | my $crc32 = shift || 1;
18 |  |  |  |  | my $adler32 = shift || 1;
19 |  |  |  |  | my $scan = shift || 0;
20 |  |  |  |  |
21 |  |  |  |  | my $inflate ;
22 |  |  |  |  | my $status ;
23 |  |  |  |  |
24 |  |  |  |  | if ($scan)
25 |  |  |  |  | {
26 |  |  |  |  | ($inflate, $status) = new Compress::Raw::Zlib::InflateScan
27 |  |  |  |  | #LimitOutput => 1,
28 |  |  |  |  | CRC32 => $crc32,
29 |  |  |  |  | ADLER32 => $adler32,
30 |  |  |  |  | WindowBits => - MAX_WBITS ;
31 |  |  |  |  | }
32 |  |  |  |  | else
33 |  |  |  |  | {
34 |  |  |  |  | ($inflate, $status) = new Compress::Raw::Zlib::Inflate
35 |  |  |  |  | AppendOutput => 1,
36 |  |  |  |  | LimitOutput => 1,
37 |  |  |  |  | CRC32 => $crc32,
38 |  |  |  |  | ADLER32 => $adler32,
39 |  |  |  |  | WindowBits => - MAX_WBITS ;
40 |  |  |  |  | }
41 |  |  |  |  |
42 |  |  |  |  | return (undef, "Could not create Inflation object: $status", $status)
43 |  |  |  |  | if $status != Z_OK ;
44 |  |  |  |  |
45 |  |  |  |  | return bless {'Inf' => $inflate,
46 |  |  |  |  | 'CompSize' => 0,
47 |  |  |  |  | 'UnCompSize' => 0,
48 |  |  |  |  | 'Error' => '',
49 |  |  |  |  | 'ConsumesInput' => 1,
50 |  |  |  |  | } ;
51 |  |  |  |  |
52 |  |  |  |  | }
53 |  |  |  |  |
54 |  |  |  |  | sub uncompr
55 |  |  |  |  | {
56 |  |  |  |  | my $self = shift ;
57 |  |  |  |  | my $from = shift ;
58 |  |  |  |  | my $to = shift ;
59 |  |  |  |  | my $eof = shift ;
60 |  |  |  |  |
61 |  |  |  |  | my $inf = $self->{Inf};
62 |  |  |  |  |
63 |  |  |  |  | my $status = $inf->inflate($from, $to, $eof);
64 |  |  |  |  | $self->{ErrorNo} = $status;
65 |  |  |  |  |
66 |  |  |  |  | if ($status != Z_OK && $status != Z_STREAM_END && $status != Z_BUF_ERROR)
67 |  |  |  |  | {
68 |  |  |  |  | $self->{Error} = "Inflation Error: $status";
69 |  |  |  |  | return STATUS_ERROR;
70 |  |  |  |  | }
71 |  |  |  |  |
72 |  |  |  |  | return STATUS_OK if $status == Z_BUF_ERROR ; # ???
73 |  |  |  |  | return STATUS_OK if $status == Z_OK ;
74 |  |  |  |  | return STATUS_ENDSTREAM if $status == Z_STREAM_END ;
75 |  |  |  |  | return STATUS_ERROR ;
76 |  |  |  |  | }
77 |  |  |  |  |
78 |  |  |  |  | sub reset
79 |  |  |  |  | {
80 |  |  |  |  | my $self = shift ;
81 |  |  |  |  | $self->{Inf}->inflateReset();
82 |  |  |  |  |
83 |  |  |  |  | return STATUS_OK ;
84 |  |  |  |  | }
85 |  |  |  |  |
86 |  |  |  |  | #sub count
87 |  |  |  |  | #{
88 |  |  |  |  | # my $self = shift ;
89 |  |  |  |  | # $self->{Inf}->inflateCount();
90 |  |  |  |  | #}
91 |  |  |  |  |
92 |  |  |  |  | sub crc32
93 |  |  |  |  | {
94 |  |  |  |  | my $self = shift ;
95 |  |  |  |  | $self->{Inf}->crc32();
96 |  |  |  |  | }
97 |  |  |  |  |
98 |  |  |  |  | sub compressedBytes
99 |  |  |  |  | {
100 |  |  |  |  | my $self = shift ;
101 |  |  |  |  | $self->{Inf}->compressedBytes();
102 |  |  |  |  | }
103 |  |  |  |  |
104 |  |  |  |  | sub uncompressedBytes
105 |  |  |  |  | {
106 |  |  |  |  | my $self = shift ;
107 |  |  |  |  | $self->{Inf}->uncompressedBytes();
108 |  |  |  |  | }
109 |  |  |  |  |
110 |  |  |  |  | sub adler32
111 |  |  |  |  | {
112 |  |  |  |  | my $self = shift ;
113 |  |  |  |  | $self->{Inf}->adler32();
114 |  |  |  |  | }
115 |  |  |  |  |
116 |  |  |  |  | sub sync
117 |  |  |  |  | {
118 |  |  |  |  | my $self = shift ;
119 |  |  |  |  | ( $self->{Inf}->inflateSync(@_) == Z_OK)
120 |  |  |  |  | ? STATUS_OK
121 |  |  |  |  | : STATUS_ERROR ;
122 |  |  |  |  | }
123 |  |  |  |  |
124 |  |  |  |  |
125 |  |  |  |  | sub getLastBlockOffset
126 |  |  |  |  | {
127 |  |  |  |  | my $self = shift ;
128 |  |  |  |  | $self->{Inf}->getLastBlockOffset();
129 |  |  |  |  | }
130 |  |  |  |  |
131 |  |  |  |  | sub getEndOffset
132 |  |  |  |  | {
133 |  |  |  |  | my $self = shift ;
134 |  |  |  |  | $self->{Inf}->getEndOffset();
135 |  |  |  |  | }
136 |  |  |  |  |
137 |  |  |  |  | sub resetLastBlockByte
138 |  |  |  |  | {
139 |  |  |  |  | my $self = shift ;
140 |  |  |  |  | $self->{Inf}->resetLastBlockByte(@_);
141 |  |  |  |  | }
142 |  |  |  |  |
143 |  |  |  |  | sub createDeflateStream
144 |  |  |  |  | {
145 |  |  |  |  | my $self = shift ;
146 |  |  |  |  | my $deflate = $self->{Inf}->createDeflateStream(@_);
147 |  |  |  |  | return bless {'Def' => $deflate,
148 |  |  |  |  | 'CompSize' => 0,
149 |  |  |  |  | 'UnCompSize' => 0,
150 |  |  |  |  | 'Error' => '',
151 |  |  |  |  | }, 'IO::Compress::Adapter::Deflate';
152 |  |  |  |  | }
153 |  |  |  |  |
154 | 1 | 11µs |  |  | 1;
155 |  |  |  |  |
156 |  |  |  |  |
157 |  |  |  |  | __END__
158 |  |  |  |  |