← Index
NYTProf Performance Profile   « line view »
For /Users/brian/bin/perls/cpan5.26.1
  Run on Sat Dec 30 01:41:10 2017
Reported on Sat Dec 30 01:44:15 2017

Filename/usr/local/perls/perl-5.26.1/lib/5.26.1/IO/Compress/Adapter/Deflate.pm
StatementsExecuted 20 statements in 1.04ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11125µs28µsIO::Compress::Adapter::Deflate::::BEGIN@3IO::Compress::Adapter::Deflate::BEGIN@3
11116µs158µsIO::Compress::Adapter::Deflate::::BEGIN@7IO::Compress::Adapter::Deflate::BEGIN@7
11116µs439µsIO::Compress::Adapter::Deflate::::BEGIN@8IO::Compress::Adapter::Deflate::BEGIN@8
11111µs24µsIO::Compress::Adapter::Deflate::::BEGIN@4IO::Compress::Adapter::Deflate::BEGIN@4
11110µs13µsIO::Compress::Adapter::Deflate::::BEGIN@5IO::Compress::Adapter::Deflate::BEGIN@5
0000s0sIO::Compress::Adapter::Deflate::::adler32IO::Compress::Adapter::Deflate::adler32
0000s0sIO::Compress::Adapter::Deflate::::closeIO::Compress::Adapter::Deflate::close
0000s0sIO::Compress::Adapter::Deflate::::comprIO::Compress::Adapter::Deflate::compr
0000s0sIO::Compress::Adapter::Deflate::::compressedBytesIO::Compress::Adapter::Deflate::compressedBytes
0000s0sIO::Compress::Adapter::Deflate::::crc32IO::Compress::Adapter::Deflate::crc32
0000s0sIO::Compress::Adapter::Deflate::::deflateParamsIO::Compress::Adapter::Deflate::deflateParams
0000s0sIO::Compress::Adapter::Deflate::::flushIO::Compress::Adapter::Deflate::flush
0000s0sIO::Compress::Adapter::Deflate::::mkCompObjectIO::Compress::Adapter::Deflate::mkCompObject
0000s0sIO::Compress::Adapter::Deflate::::resetIO::Compress::Adapter::Deflate::reset
0000s0sIO::Compress::Adapter::Deflate::::uncompressedBytesIO::Compress::Adapter::Deflate::uncompressedBytes
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::Adapter::Deflate ;
2
3234µs231µs
# spent 28µs (25+3) within IO::Compress::Adapter::Deflate::BEGIN@3 which was called: # once (25µs+3µs) by IO::Compress::RawDeflate::BEGIN@11 at line 3
use strict;
# spent 28µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@3 # spent 3µs making 1 call to strict::import
4231µs237µs
# spent 24µs (11+13) within IO::Compress::Adapter::Deflate::BEGIN@4 which was called: # once (11µs+13µs) by IO::Compress::RawDeflate::BEGIN@11 at line 4
use warnings;
# spent 24µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@4 # spent 13µs making 1 call to warnings::import
5239µs216µs
# spent 13µs (10+3) within IO::Compress::Adapter::Deflate::BEGIN@5 which was called: # once (10µs+3µs) by IO::Compress::RawDeflate::BEGIN@11 at line 5
use bytes;
# spent 13µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@5 # spent 3µs making 1 call to bytes::import
6
7358µs3300µs
# spent 158µs (16+142) within IO::Compress::Adapter::Deflate::BEGIN@7 which was called: # once (16µs+142µs) by IO::Compress::RawDeflate::BEGIN@11 at line 7
use IO::Compress::Base::Common 2.074 qw(:Status);
# spent 158µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@7 # spent 132µs making 1 call to Exporter::import # spent 10µs making 1 call to version::_VERSION
83841µs3862µs
# spent 439µs (16+423) within IO::Compress::Adapter::Deflate::BEGIN@8 which was called: # once (16µs+423µs) by IO::Compress::RawDeflate::BEGIN@11 at line 8
use Compress::Raw::Zlib 2.074 qw( !crc32 !adler32 ) ;
# spent 439µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@8 # spent 413µs making 1 call to Exporter::import # spent 10µs making 1 call to version::_VERSION
9
1011µsrequire Exporter;
11our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, @EXPORT, %DEFLATE_CONSTANTS);
12
1311µs$VERSION = '2.074';
1419µs@ISA = qw(Exporter);
1517µs@EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS;
1615µs%EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS;
1714µs@EXPORT = @EXPORT_OK;
1812µs%DEFLATE_CONSTANTS = %EXPORT_TAGS ;
19
20sub 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
43sub 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
61sub 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
80sub 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
90sub 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
107sub 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
138sub compressedBytes
139{
140 my $self = shift ;
141
142 $self->{Def}->compressedBytes();
143}
144
145sub uncompressedBytes
146{
147 my $self = shift ;
148 $self->{Def}->uncompressedBytes();
149}
150
- -
154sub crc32
155{
156 my $self = shift ;
157 $self->{Def}->crc32();
158}
159
160sub adler32
161{
162 my $self = shift ;
163 $self->{Def}->adler32();
164}
165
166
167110µs1;
168
169__END__