← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Wed Dec 14 15:57:08 2022
Reported on Wed Dec 14 16:00:30 2022

Filename/Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/IO/Compress/RawDeflate.pm
StatementsExecuted 41 statements in 2.89ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1115.11ms21.1msIO::Compress::RawDeflate::::BEGIN@9IO::Compress::RawDeflate::BEGIN@9
1111.42ms9.41msIO::Compress::RawDeflate::::BEGIN@11IO::Compress::RawDeflate::BEGIN@11
11122µs24µsIO::Compress::RawDeflate::::BEGIN@5IO::Compress::RawDeflate::BEGIN@5
11117µs54µsIO::Compress::RawDeflate::::BEGIN@12IO::Compress::RawDeflate::BEGIN@12
11117µs55µsIO::Compress::RawDeflate::::BEGIN@137IO::Compress::RawDeflate::BEGIN@137
11112µs71µsIO::Compress::RawDeflate::::BEGIN@150IO::Compress::RawDeflate::BEGIN@150
11111µs241µsIO::Compress::RawDeflate::::BEGIN@10IO::Compress::RawDeflate::BEGIN@10
1115µs25µsIO::Compress::RawDeflate::::BEGIN@6IO::Compress::RawDeflate::BEGIN@6
1115µs6µsIO::Compress::RawDeflate::::BEGIN@7IO::Compress::RawDeflate::BEGIN@7
0000s0sIO::Compress::RawDeflate::::ckParamsIO::Compress::RawDeflate::ckParams
0000s0sIO::Compress::RawDeflate::::createMergeIO::Compress::RawDeflate::createMerge
0000s0sIO::Compress::RawDeflate::::deflateParamsIO::Compress::RawDeflate::deflateParams
0000s0sIO::Compress::RawDeflate::::getExtraParamsIO::Compress::RawDeflate::getExtraParams
0000s0sIO::Compress::RawDeflate::::getFileInfoIO::Compress::RawDeflate::getFileInfo
0000s0sIO::Compress::RawDeflate::::getInverseClassIO::Compress::RawDeflate::getInverseClass
0000s0sIO::Compress::RawDeflate::::getZlibParamsIO::Compress::RawDeflate::getZlibParams
0000s0sIO::Compress::RawDeflate::::mkCompIO::Compress::RawDeflate::mkComp
0000s0sIO::Compress::RawDeflate::::mkFinalTrailerIO::Compress::RawDeflate::mkFinalTrailer
0000s0sIO::Compress::RawDeflate::::mkHeaderIO::Compress::RawDeflate::mkHeader
0000s0sIO::Compress::RawDeflate::::mkTrailerIO::Compress::RawDeflate::mkTrailer
0000s0sIO::Compress::RawDeflate::::newIO::Compress::RawDeflate::new
0000s0sIO::Compress::RawDeflate::::rawdeflateIO::Compress::RawDeflate::rawdeflate
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package IO::Compress::RawDeflate ;
2
3# create RFC1951
4#
5223µs226µs
# spent 24µs (22+2) within IO::Compress::RawDeflate::BEGIN@5 which was called: # once (22µs+2µs) by IO::Compress::Gzip::BEGIN@11 at line 5
use strict ;
# spent 24µs making 1 call to IO::Compress::RawDeflate::BEGIN@5 # spent 2µs making 1 call to strict::import
6220µs245µs
# spent 25µs (5+20) within IO::Compress::RawDeflate::BEGIN@6 which was called: # once (5µs+20µs) by IO::Compress::Gzip::BEGIN@11 at line 6
use warnings;
# spent 25µs making 1 call to IO::Compress::RawDeflate::BEGIN@6 # spent 20µs making 1 call to warnings::import
7214µs27µs
# spent 6µs (5+1000ns) within IO::Compress::RawDeflate::BEGIN@7 which was called: # once (5µs+1000ns) by IO::Compress::Gzip::BEGIN@11 at line 7
use bytes;
# spent 6µs making 1 call to IO::Compress::RawDeflate::BEGIN@7 # spent 1µs making 1 call to bytes::import
8
93533µs321.1ms
# spent 21.1ms (5.11+16.0) within IO::Compress::RawDeflate::BEGIN@9 which was called: # once (5.11ms+16.0ms) by IO::Compress::Gzip::BEGIN@11 at line 9
use IO::Compress::Base 2.106 ;
# spent 21.1ms making 1 call to IO::Compress::RawDeflate::BEGIN@9 # spent 17µs making 1 call to Exporter::import # spent 6µs making 1 call to UNIVERSAL::VERSION
10339µs3471µs
# spent 241µs (11+230) within IO::Compress::RawDeflate::BEGIN@10 which was called: # once (11µs+230µs) by IO::Compress::Gzip::BEGIN@11 at line 10
use IO::Compress::Base::Common 2.106 qw(:Status :Parse);
# spent 241µs making 1 call to IO::Compress::RawDeflate::BEGIN@10 # spent 224µs making 1 call to Exporter::import # spent 6µs making 1 call to UNIVERSAL::VERSION
113547µs39.74ms
# spent 9.41ms (1.42+7.99) within IO::Compress::RawDeflate::BEGIN@11 which was called: # once (1.42ms+7.99ms) by IO::Compress::Gzip::BEGIN@11 at line 11
use IO::Compress::Adapter::Deflate 2.106 ;
# spent 9.41ms making 1 call to IO::Compress::RawDeflate::BEGIN@11 # spent 313µs making 1 call to Exporter::import # spent 15µs making 1 call to UNIVERSAL::VERSION
1231.03ms391µs
# spent 54µs (17+37) within IO::Compress::RawDeflate::BEGIN@12 which was called: # once (17µs+37µs) by IO::Compress::Gzip::BEGIN@11 at line 12
use Compress::Raw::Zlib 2.103 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
# spent 54µs making 1 call to IO::Compress::RawDeflate::BEGIN@12 # spent 30µs making 1 call to Exporter::import # spent 7µs making 1 call to UNIVERSAL::VERSION
13
1411µsrequire Exporter ;
15
16our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
17
1811µs$VERSION = '2.106';
1910s$RawDeflateError = '';
20
21114µs@ISA = qw(IO::Compress::Base Exporter);
2211µs@EXPORT_OK = qw( $RawDeflateError rawdeflate ) ;
2319µspush @EXPORT_OK, @IO::Compress::Adapter::Deflate::EXPORT_OK ;
24
2514µs%EXPORT_TAGS = %IO::Compress::Adapter::Deflate::DEFLATE_CONSTANTS;
26
27
28{
2920s my %seen;
3011µs foreach (keys %EXPORT_TAGS )
31 {
32 push @{$EXPORT_TAGS{constants}},
33 grep { !$seen{$_}++ }
34423µs @{ $EXPORT_TAGS{$_} }
35 }
3611µs $EXPORT_TAGS{all} = $EXPORT_TAGS{constants} ;
37}
38
39
4012µs%DEFLATE_CONSTANTS = %EXPORT_TAGS;
41
42#push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
43
4414µs132µsExporter::export_ok_tags('all');
# spent 32µs making 1 call to Exporter::export_ok_tags
45
- -
48sub new
49{
50 my $class = shift ;
51
52 my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$RawDeflateError);
53
54 return $obj->_create(undef, @_);
55}
56
57sub rawdeflate
58{
59 my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$RawDeflateError);
60 return $obj->_def(@_);
61}
62
63sub ckParams
64{
65 my $self = shift ;
66 my $got = shift;
67
68 return 1 ;
69}
70
71sub mkComp
72{
73 my $self = shift ;
74 my $got = shift ;
75
76 my ($obj, $errstr, $errno) = IO::Compress::Adapter::Deflate::mkCompObject(
77 $got->getValue('crc32'),
78 $got->getValue('adler32'),
79 $got->getValue('level'),
80 $got->getValue('strategy')
81 );
82
83 return $self->saveErrorString(undef, $errstr, $errno)
84 if ! defined $obj;
85
86 return $obj;
87}
88
89
90sub mkHeader
91{
92 my $self = shift ;
93 return '';
94}
95
96sub mkTrailer
97{
98 my $self = shift ;
99 return '';
100}
101
102sub mkFinalTrailer
103{
104 return '';
105}
106
107
108#sub newHeader
109#{
110# my $self = shift ;
111# return '';
112#}
113
114sub getExtraParams
115{
116 my $self = shift ;
117 return getZlibParams();
118}
119
12018µs25µsour %PARAMS = (
# spent 5µs making 2 calls to Compress::Raw::Zlib::__ANON__[Compress/Raw/Zlib.pm:114], avg 2µs/call
121 #'method' => [IO::Compress::Base::Common::Parse_unsigned, Z_DEFLATED],
122 'level' => [IO::Compress::Base::Common::Parse_signed, Z_DEFAULT_COMPRESSION],
123 'strategy' => [IO::Compress::Base::Common::Parse_signed, Z_DEFAULT_STRATEGY],
124
125 'crc32' => [IO::Compress::Base::Common::Parse_boolean, 0],
126 'adler32' => [IO::Compress::Base::Common::Parse_boolean, 0],
127 'merge' => [IO::Compress::Base::Common::Parse_boolean, 0],
128 );
129
130sub getZlibParams
131{
132 return %PARAMS;
133}
134
135sub getInverseClass
136{
1372109µs293µs
# spent 55µs (17+38) within IO::Compress::RawDeflate::BEGIN@137 which was called: # once (17µs+38µs) by IO::Compress::Gzip::BEGIN@11 at line 137
no warnings 'once';
# spent 55µs making 1 call to IO::Compress::RawDeflate::BEGIN@137 # spent 38µs making 1 call to warnings::unimport
138 return ('IO::Uncompress::RawInflate',
139 \$IO::Uncompress::RawInflate::RawInflateError);
140}
141
142sub getFileInfo
143{
144 my $self = shift ;
145 my $params = shift;
146 my $file = shift ;
147
148}
149
1502493µs2130µs
# spent 71µs (12+59) within IO::Compress::RawDeflate::BEGIN@150 which was called: # once (12µs+59µs) by IO::Compress::Gzip::BEGIN@11 at line 150
use Fcntl qw(SEEK_SET);
# spent 71µs making 1 call to IO::Compress::RawDeflate::BEGIN@150 # spent 59µs making 1 call to Exporter::import
151
152sub createMerge
153{
154 my $self = shift ;
155 my $outValue = shift ;
156 my $outType = shift ;
157
158 my ($invClass, $error_ref) = $self->getInverseClass();
159 eval "require $invClass"
160 or die "aaaahhhh" ;
161
162 my $inf = $invClass->new( $outValue,
163 Transparent => 0,
164 #Strict => 1,
165 AutoClose => 0,
166 Scan => 1)
167 or return $self->saveErrorString(undef, "Cannot create InflateScan object: $$error_ref" ) ;
168
169 my $end_offset = 0;
170 $inf->scan()
171 or return $self->saveErrorString(undef, "Error Scanning: $$error_ref", $inf->errorNo) ;
172 $inf->zap($end_offset)
173 or return $self->saveErrorString(undef, "Error Zapping: $$error_ref", $inf->errorNo) ;
174
175 my $def = *$self->{Compress} = $inf->createDeflate();
176
177 *$self->{Header} = *$inf->{Info}{Header};
178 *$self->{UnCompSize} = *$inf->{UnCompSize}->clone();
179 *$self->{CompSize} = *$inf->{CompSize}->clone();
180 # TODO -- fix this
181 #*$self->{CompSize} = U64->new(0, *$self->{UnCompSize_32bit});
182
183
184 if ( $outType eq 'buffer')
185 { substr( ${ *$self->{Buffer} }, $end_offset) = '' }
186 elsif ($outType eq 'handle' || $outType eq 'filename') {
187 *$self->{FH} = *$inf->{FH} ;
188 delete *$inf->{FH};
189 *$self->{FH}->flush() ;
190 *$self->{Handle} = 1 if $outType eq 'handle';
191
192 #seek(*$self->{FH}, $end_offset, SEEK_SET)
193 *$self->{FH}->seek($end_offset, SEEK_SET)
194 or return $self->saveErrorString(undef, $!, $!) ;
195 }
196
197 return $def ;
198}
199
200#### zlib specific methods
201
202sub deflateParams
203{
204 my $self = shift ;
205
206 my $level = shift ;
207 my $strategy = shift ;
208
209 my $status = *$self->{Compress}->deflateParams(Level => $level, Strategy => $strategy) ;
210 return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo})
211 if $status == STATUS_ERROR;
212
213 return 1;
214}
215
- -
219115µs1;
220
221__END__