← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 17:10:45 2013
Reported on Tue Oct 15 17:11:34 2013

Filename/usr/lib/perl/5.10/IO/Compress/RawDeflate.pm
StatementsExecuted 45 statements in 1.78ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1114.62ms5.57msIO::Compress::RawDeflate::::BEGIN@10IO::Compress::RawDeflate::BEGIN@10
111930µs1.37msIO::Compress::RawDeflate::::BEGIN@12IO::Compress::RawDeflate::BEGIN@12
11124µs338µsIO::Compress::RawDeflate::::BEGIN@11IO::Compress::RawDeflate::BEGIN@11
11120µs211µsIO::Compress::RawDeflate::::BEGIN@145IO::Compress::RawDeflate::BEGIN@145
11119µs24µsIO::Compress::RawDeflate::::BEGIN@7IO::Compress::RawDeflate::BEGIN@7
11118µs21µsIO::Compress::RawDeflate::::BEGIN@5IO::Compress::RawDeflate::BEGIN@5
11116µs71µsIO::Compress::RawDeflate::::BEGIN@178IO::Compress::RawDeflate::BEGIN@178
11115µs79µsIO::Compress::RawDeflate::::BEGIN@146IO::Compress::RawDeflate::BEGIN@146
1119µs21µsIO::Compress::RawDeflate::::BEGIN@6IO::Compress::RawDeflate::BEGIN@6
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#
5327µs225µs
# spent 21µs (18+4) within IO::Compress::RawDeflate::BEGIN@5 which was called: # once (18µs+4µs) by IO::Compress::Gzip::BEGIN@11 at line 5
use strict ;
# spent 21µs making 1 call to IO::Compress::RawDeflate::BEGIN@5 # spent 4µs making 1 call to strict::import
6354µs233µs
# spent 21µs (9+12) within IO::Compress::RawDeflate::BEGIN@6 which was called: # once (9µs+12µs) by IO::Compress::Gzip::BEGIN@11 at line 6
use warnings;
# spent 21µs making 1 call to IO::Compress::RawDeflate::BEGIN@6 # spent 12µs making 1 call to warnings::import
7345µs230µs
# spent 24µs (19+6) within IO::Compress::RawDeflate::BEGIN@7 which was called: # once (19µs+6µs) by IO::Compress::Gzip::BEGIN@11 at line 7
use bytes;
# spent 24µs making 1 call to IO::Compress::RawDeflate::BEGIN@7 # spent 6µs making 1 call to bytes::import
8
9
103170µs35.60ms
# spent 5.57ms (4.62+941µs) within IO::Compress::RawDeflate::BEGIN@10 which was called: # once (4.62ms+941µs) by IO::Compress::Gzip::BEGIN@11 at line 10
use IO::Compress::Base 2.020 ;
# spent 5.57ms making 1 call to IO::Compress::RawDeflate::BEGIN@10 # spent 25µs making 1 call to Exporter::import # spent 12µs making 1 call to UNIVERSAL::VERSION
11379µs3652µs
# spent 338µs (24+314) within IO::Compress::RawDeflate::BEGIN@11 which was called: # once (24µs+314µs) by IO::Compress::Gzip::BEGIN@11 at line 11
use IO::Compress::Base::Common 2.020 qw(:Status createSelfTiedObject);
# spent 338µs making 1 call to IO::Compress::RawDeflate::BEGIN@11 # spent 289µs making 1 call to Exporter::import # spent 25µs making 1 call to UNIVERSAL::VERSION
123678µs21.39ms
# spent 1.37ms (930µs+444µs) within IO::Compress::RawDeflate::BEGIN@12 which was called: # once (930µs+444µs) by IO::Compress::Gzip::BEGIN@11 at line 12
use IO::Compress::Adapter::Deflate 2.020 ;
# spent 1.37ms making 1 call to IO::Compress::RawDeflate::BEGIN@12 # spent 16µs making 1 call to UNIVERSAL::VERSION
13
141900nsrequire Exporter ;
15
16
1711µsour ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
18
191700ns$VERSION = '2.020';
201300ns$RawDeflateError = '';
21
22117µs@ISA = qw(Exporter IO::Compress::Base);
231800ns@EXPORT_OK = qw( $RawDeflateError rawdeflate ) ;
24
2515µs%EXPORT_TAGS = ( flush => [qw{
26 Z_NO_FLUSH
27 Z_PARTIAL_FLUSH
28 Z_SYNC_FLUSH
29 Z_FULL_FLUSH
30 Z_FINISH
31 Z_BLOCK
32 }],
33 level => [qw{
34 Z_NO_COMPRESSION
35 Z_BEST_SPEED
36 Z_BEST_COMPRESSION
37 Z_DEFAULT_COMPRESSION
38 }],
39 strategy => [qw{
40 Z_FILTERED
41 Z_HUFFMAN_ONLY
42 Z_RLE
43 Z_FIXED
44 Z_DEFAULT_STRATEGY
45 }],
46
47 );
48
49{
5045µs my %seen;
51 foreach (keys %EXPORT_TAGS )
52 {
53 push @{$EXPORT_TAGS{constants}},
54 grep { !$seen{$_}++ }
55314µs @{ $EXPORT_TAGS{$_} }
56 }
57 $EXPORT_TAGS{all} = $EXPORT_TAGS{constants} ;
58}
59
60
6112µs%DEFLATE_CONSTANTS = %EXPORT_TAGS;
62
631900nspush @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
64
6514µs125µsExporter::export_ok_tags('all');
# spent 25µs making 1 call to Exporter::export_ok_tags
66
67
68
69sub new
70{
71 my $class = shift ;
72
73 my $obj = createSelfTiedObject($class, \$RawDeflateError);
74
75 return $obj->_create(undef, @_);
76}
77
78sub rawdeflate
79{
80 my $obj = createSelfTiedObject(undef, \$RawDeflateError);
81 return $obj->_def(@_);
82}
83
84sub ckParams
85{
86 my $self = shift ;
87 my $got = shift;
88
89 return 1 ;
90}
91
92sub mkComp
93{
94 my $self = shift ;
95 my $got = shift ;
96
97 my ($obj, $errstr, $errno) = IO::Compress::Adapter::Deflate::mkCompObject(
98 $got->value('CRC32'),
99 $got->value('Adler32'),
100 $got->value('Level'),
101 $got->value('Strategy')
102 );
103
104 return $self->saveErrorString(undef, $errstr, $errno)
105 if ! defined $obj;
106
107 return $obj;
108}
109
110
111sub mkHeader
112{
113 my $self = shift ;
114 return '';
115}
116
117sub mkTrailer
118{
119 my $self = shift ;
120 return '';
121}
122
123sub mkFinalTrailer
124{
125 return '';
126}
127
128
129#sub newHeader
130#{
131# my $self = shift ;
132# return '';
133#}
134
135sub getExtraParams
136{
137 my $self = shift ;
138 return $self->getZlibParams();
139}
140
141sub getZlibParams
142{
143 my $self = shift ;
144
145367µs3401µs
# spent 211µs (20+191) within IO::Compress::RawDeflate::BEGIN@145 which was called: # once (20µs+191µs) by IO::Compress::Gzip::BEGIN@11 at line 145
use IO::Compress::Base::Common 2.020 qw(:Parse);
# spent 211µs making 1 call to IO::Compress::RawDeflate::BEGIN@145 # spent 175µs making 1 call to Exporter::import # spent 15µs making 1 call to UNIVERSAL::VERSION
1463202µs3142µs
# spent 79µs (15+63) within IO::Compress::RawDeflate::BEGIN@146 which was called: # once (15µs+63µs) by IO::Compress::Gzip::BEGIN@11 at line 146
use Compress::Raw::Zlib 2.020 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
# spent 79µs making 1 call to IO::Compress::RawDeflate::BEGIN@146 # spent 49µs making 1 call to Exporter::import # spent 15µs making 1 call to UNIVERSAL::VERSION
147
148
149 return (
150
151 # zlib behaviour
152 #'Method' => [0, 1, Parse_unsigned, Z_DEFLATED],
153 'Level' => [0, 1, Parse_signed, Z_DEFAULT_COMPRESSION],
154 'Strategy' => [0, 1, Parse_signed, Z_DEFAULT_STRATEGY],
155
156 'CRC32' => [0, 1, Parse_boolean, 0],
157 'ADLER32' => [0, 1, Parse_boolean, 0],
158 'Merge' => [1, 1, Parse_boolean, 0],
159 );
160
161
162}
163
164sub getInverseClass
165{
166 return ('IO::Uncompress::RawInflate',
167 \$IO::Uncompress::RawInflate::RawInflateError);
168}
169
170sub getFileInfo
171{
172 my $self = shift ;
173 my $params = shift;
174 my $file = shift ;
175
176}
177
1783396µs2126µs
# spent 71µs (16+55) within IO::Compress::RawDeflate::BEGIN@178 which was called: # once (16µs+55µs) by IO::Compress::Gzip::BEGIN@11 at line 178
use IO::Seekable qw(SEEK_SET);
# spent 71µs making 1 call to IO::Compress::RawDeflate::BEGIN@178 # spent 55µs making 1 call to Exporter::import
179
180sub createMerge
181{
182 my $self = shift ;
183 my $outValue = shift ;
184 my $outType = shift ;
185
186 my ($invClass, $error_ref) = $self->getInverseClass();
187 eval "require $invClass"
188 or die "aaaahhhh" ;
189
190 my $inf = $invClass->new( $outValue,
191 Transparent => 0,
192 #Strict => 1,
193 AutoClose => 0,
194 Scan => 1)
195 or return $self->saveErrorString(undef, "Cannot create InflateScan object: $$error_ref" ) ;
196
197 my $end_offset = 0;
198 $inf->scan()
199 or return $self->saveErrorString(undef, "Error Scanning: $$error_ref", $inf->errorNo) ;
200 $inf->zap($end_offset)
201 or return $self->saveErrorString(undef, "Error Zapping: $$error_ref", $inf->errorNo) ;
202
203 my $def = *$self->{Compress} = $inf->createDeflate();
204
205 *$self->{Header} = *$inf->{Info}{Header};
206 *$self->{UnCompSize} = *$inf->{UnCompSize}->clone();
207 *$self->{CompSize} = *$inf->{CompSize}->clone();
208 # TODO -- fix this
209 #*$self->{CompSize} = new U64(0, *$self->{UnCompSize_32bit});
210
211
212 if ( $outType eq 'buffer')
213 { substr( ${ *$self->{Buffer} }, $end_offset) = '' }
214 elsif ($outType eq 'handle' || $outType eq 'filename') {
215 *$self->{FH} = *$inf->{FH} ;
216 delete *$inf->{FH};
217 *$self->{FH}->flush() ;
218 *$self->{Handle} = 1 if $outType eq 'handle';
219
220 #seek(*$self->{FH}, $end_offset, SEEK_SET)
221 *$self->{FH}->seek($end_offset, SEEK_SET)
222 or return $self->saveErrorString(undef, $!, $!) ;
223 }
224
225 return $def ;
226}
227
228#### zlib specific methods
229
230sub deflateParams
231{
232 my $self = shift ;
233
234 my $level = shift ;
235 my $strategy = shift ;
236
237 my $status = *$self->{Compress}->deflateParams(Level => $level, Strategy => $strategy) ;
238 return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo})
239 if $status == STATUS_ERROR;
240
241 return 1;
242}
243
- -
247115µs1;
248
249__END__