← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:07 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/IO/Compress/Deflate.pm
StatementsExecuted 28 statements in 625µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111683µs12.9msIO::Compress::Deflate::::BEGIN@11IO::Compress::Deflate::BEGIN@11
111351µs776µsIO::Compress::Deflate::::BEGIN@14IO::Compress::Deflate::BEGIN@14
11114µs108µsIO::Compress::Deflate::::BEGIN@12IO::Compress::Deflate::BEGIN@12
1118µs9µsIO::Compress::Deflate::::BEGIN@5IO::Compress::Deflate::BEGIN@5
1116µs7µsIO::Compress::Deflate::::BEGIN@7IO::Compress::Deflate::BEGIN@7
1115µs9µsIO::Compress::Deflate::::BEGIN@15IO::Compress::Deflate::BEGIN@15
1114µs8µsIO::Compress::Deflate::::BEGIN@6IO::Compress::Deflate::BEGIN@6
0000s0sIO::Compress::Deflate::::bitmaskIO::Compress::Deflate::bitmask
0000s0sIO::Compress::Deflate::::ckParamsIO::Compress::Deflate::ckParams
0000s0sIO::Compress::Deflate::::deflateIO::Compress::Deflate::deflate
0000s0sIO::Compress::Deflate::::getExtraParamsIO::Compress::Deflate::getExtraParams
0000s0sIO::Compress::Deflate::::getFileInfoIO::Compress::Deflate::getFileInfo
0000s0sIO::Compress::Deflate::::getInverseClassIO::Compress::Deflate::getInverseClass
0000s0sIO::Compress::Deflate::::mkDeflateHdrIO::Compress::Deflate::mkDeflateHdr
0000s0sIO::Compress::Deflate::::mkFinalTrailerIO::Compress::Deflate::mkFinalTrailer
0000s0sIO::Compress::Deflate::::mkHeaderIO::Compress::Deflate::mkHeader
0000s0sIO::Compress::Deflate::::mkTrailerIO::Compress::Deflate::mkTrailer
0000s0sIO::Compress::Deflate::::newIO::Compress::Deflate::new
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::Deflate ;
2
315µsrequire 5.006 ;
4
5214µs211µs
# spent 9µs (8+1) within IO::Compress::Deflate::BEGIN@5 which was called: # once (8µs+1µs) by Search::Elasticsearch::Role::Cxn::BEGIN@8 at line 5
use strict ;
# spent 9µs making 1 call to IO::Compress::Deflate::BEGIN@5 # spent 2µs making 1 call to strict::import
6211µs211µs
# spent 8µs (4+3) within IO::Compress::Deflate::BEGIN@6 which was called: # once (4µs+3µs) by Search::Elasticsearch::Role::Cxn::BEGIN@8 at line 6
use warnings;
# spent 8µs making 1 call to IO::Compress::Deflate::BEGIN@6 # spent 3µs making 1 call to warnings::import
7222µs29µs
# spent 7µs (6+2) within IO::Compress::Deflate::BEGIN@7 which was called: # once (6µs+2µs) by Search::Elasticsearch::Role::Cxn::BEGIN@8 at line 7
use bytes;
# spent 7µs making 1 call to IO::Compress::Deflate::BEGIN@7 # spent 2µs making 1 call to bytes::import
8
91300nsrequire Exporter ;
10
11373µs212.9ms
# spent 12.9ms (683µs+12.2) within IO::Compress::Deflate::BEGIN@11 which was called: # once (683µs+12.2ms) by Search::Elasticsearch::Role::Cxn::BEGIN@8 at line 11
use IO::Compress::RawDeflate 2.068 ();
# spent 12.9ms making 1 call to IO::Compress::Deflate::BEGIN@11 # spent 5µs making 1 call to UNIVERSAL::VERSION
12331µs3201µs
# spent 108µs (14+94) within IO::Compress::Deflate::BEGIN@12 which was called: # once (14µs+94µs) by Search::Elasticsearch::Role::Cxn::BEGIN@8 at line 12
use IO::Compress::Adapter::Deflate 2.068 ;
# spent 108µs making 1 call to IO::Compress::Deflate::BEGIN@12 # spent 91µs making 1 call to Exporter::import # spent 3µs making 1 call to UNIVERSAL::VERSION
13
14376µs3826µs
# spent 776µs (351+425) within IO::Compress::Deflate::BEGIN@14 which was called: # once (351µs+425µs) by Search::Elasticsearch::Role::Cxn::BEGIN@8 at line 14
use IO::Compress::Zlib::Constants 2.068 ;
# spent 776µs making 1 call to IO::Compress::Deflate::BEGIN@14 # spent 44µs making 1 call to Exporter::import # spent 5µs making 1 call to UNIVERSAL::VERSION
153376µs213µs
# spent 9µs (5+4) within IO::Compress::Deflate::BEGIN@15 which was called: # once (5µs+4µs) by Search::Elasticsearch::Role::Cxn::BEGIN@8 at line 15
use IO::Compress::Base::Common 2.068 qw();
# spent 9µs making 1 call to IO::Compress::Deflate::BEGIN@15 # spent 4µs making 1 call to UNIVERSAL::VERSION
16
17
18our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $DeflateError);
19
201200ns$VERSION = '2.068';
211100ns$DeflateError = '';
22
2316µs@ISA = qw(Exporter IO::Compress::RawDeflate);
241400ns@EXPORT_OK = qw( $DeflateError deflate ) ;
2512µs%EXPORT_TAGS = %IO::Compress::RawDeflate::DEFLATE_CONSTANTS ;
26
271600nspush @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
2812µs111µsExporter::export_ok_tags('all');
# spent 11µs making 1 call to Exporter::export_ok_tags
29
30
31sub new
32{
33 my $class = shift ;
34
35 my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$DeflateError);
36 return $obj->_create(undef, @_);
37}
38
39sub deflate
40{
41 my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$DeflateError);
42 return $obj->_def(@_);
43}
44
45
46sub bitmask($$$$)
47{
48 my $into = shift ;
49 my $value = shift ;
50 my $offset = shift ;
51 my $mask = shift ;
52
53 return $into | (($value & $mask) << $offset ) ;
54}
55
56sub mkDeflateHdr($$$;$)
57{
58 my $method = shift ;
59 my $cinfo = shift;
60 my $level = shift;
61 my $fdict_adler = shift ;
62
63 my $cmf = 0;
64 my $flg = 0;
65 my $fdict = 0;
66 $fdict = 1 if defined $fdict_adler;
67
68 $cmf = bitmask($cmf, $method, ZLIB_CMF_CM_OFFSET, ZLIB_CMF_CM_BITS);
69 $cmf = bitmask($cmf, $cinfo, ZLIB_CMF_CINFO_OFFSET, ZLIB_CMF_CINFO_BITS);
70
71 $flg = bitmask($flg, $fdict, ZLIB_FLG_FDICT_OFFSET, ZLIB_FLG_FDICT_BITS);
72 $flg = bitmask($flg, $level, ZLIB_FLG_LEVEL_OFFSET, ZLIB_FLG_LEVEL_BITS);
73
74 my $fcheck = 31 - ($cmf * 256 + $flg) % 31 ;
75 $flg = bitmask($flg, $fcheck, ZLIB_FLG_FCHECK_OFFSET, ZLIB_FLG_FCHECK_BITS);
76
77 my $hdr = pack("CC", $cmf, $flg) ;
78 $hdr .= pack("N", $fdict_adler) if $fdict ;
79
80 return $hdr;
81}
82
83sub mkHeader
84{
85 my $self = shift ;
86 my $param = shift ;
87
88 my $level = $param->getValue('level');
89 my $strategy = $param->getValue('strategy');
90
91 my $lflag ;
92 $level = 6
93 if $level == Z_DEFAULT_COMPRESSION ;
94
95 if (ZLIB_VERNUM >= 0x1210)
96 {
97 if ($strategy >= Z_HUFFMAN_ONLY || $level < 2)
98 { $lflag = ZLIB_FLG_LEVEL_FASTEST }
99 elsif ($level < 6)
100 { $lflag = ZLIB_FLG_LEVEL_FAST }
101 elsif ($level == 6)
102 { $lflag = ZLIB_FLG_LEVEL_DEFAULT }
103 else
104 { $lflag = ZLIB_FLG_LEVEL_SLOWEST }
105 }
106 else
107 {
108 $lflag = ($level - 1) >> 1 ;
109 $lflag = 3 if $lflag > 3 ;
110 }
111
112 #my $wbits = (MAX_WBITS - 8) << 4 ;
113 my $wbits = 7;
114 mkDeflateHdr(ZLIB_CMF_CM_DEFLATED, $wbits, $lflag);
115}
116
117sub ckParams
118{
119 my $self = shift ;
120 my $got = shift;
121
122 $got->setValue('adler32' => 1);
123 return 1 ;
124}
125
126
127sub mkTrailer
128{
129 my $self = shift ;
130 return pack("N", *$self->{Compress}->adler32()) ;
131}
132
133sub mkFinalTrailer
134{
135 return '';
136}
137
138#sub newHeader
139#{
140# my $self = shift ;
141# return *$self->{Header};
142#}
143
144sub getExtraParams
145{
146 my $self = shift ;
147 return $self->getZlibParams(),
148}
149
150sub getInverseClass
151{
152 return ('IO::Uncompress::Inflate',
153 \$IO::Uncompress::Inflate::InflateError);
154}
155
156sub getFileInfo
157{
158 my $self = shift ;
159 my $params = shift;
160 my $file = shift ;
161
162}
163
- -
16615µs1;
167
168__END__