← 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/Bzip2.pm
StatementsExecuted 14 statements in 871µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11130µs33µsIO::Compress::Adapter::Bzip2::::BEGIN@3IO::Compress::Adapter::Bzip2::BEGIN@3
11118µs134µsIO::Compress::Adapter::Bzip2::::BEGIN@9IO::Compress::Adapter::Bzip2::BEGIN@9
11117µs184µsIO::Compress::Adapter::Bzip2::::BEGIN@7IO::Compress::Adapter::Bzip2::BEGIN@7
11114µs22µsIO::Compress::Adapter::Bzip2::::BEGIN@4IO::Compress::Adapter::Bzip2::BEGIN@4
1119µs11µsIO::Compress::Adapter::Bzip2::::BEGIN@5IO::Compress::Adapter::Bzip2::BEGIN@5
0000s0sIO::Compress::Adapter::Bzip2::::closeIO::Compress::Adapter::Bzip2::close
0000s0sIO::Compress::Adapter::Bzip2::::comprIO::Compress::Adapter::Bzip2::compr
0000s0sIO::Compress::Adapter::Bzip2::::compressedBytesIO::Compress::Adapter::Bzip2::compressedBytes
0000s0sIO::Compress::Adapter::Bzip2::::flushIO::Compress::Adapter::Bzip2::flush
0000s0sIO::Compress::Adapter::Bzip2::::mkCompObjectIO::Compress::Adapter::Bzip2::mkCompObject
0000s0sIO::Compress::Adapter::Bzip2::::resetIO::Compress::Adapter::Bzip2::reset
0000s0sIO::Compress::Adapter::Bzip2::::uncompressedBytesIO::Compress::Adapter::Bzip2::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::Bzip2 ;
2
3238µs236µs
# spent 33µs (30+3) within IO::Compress::Adapter::Bzip2::BEGIN@3 which was called: # once (30µs+3µs) by IO::Compress::Bzip2::BEGIN@11 at line 3
use strict;
# spent 33µs making 1 call to IO::Compress::Adapter::Bzip2::BEGIN@3 # spent 3µs making 1 call to strict::import
4230µs230µs
# spent 22µs (14+8) within IO::Compress::Adapter::Bzip2::BEGIN@4 which was called: # once (14µs+8µs) by IO::Compress::Bzip2::BEGIN@11 at line 4
use warnings;
# spent 22µs making 1 call to IO::Compress::Adapter::Bzip2::BEGIN@4 # spent 8µs making 1 call to warnings::import
5248µs213µs
# spent 11µs (9+2) within IO::Compress::Adapter::Bzip2::BEGIN@5 which was called: # once (9µs+2µs) by IO::Compress::Bzip2::BEGIN@11 at line 5
use bytes;
# spent 11µs making 1 call to IO::Compress::Adapter::Bzip2::BEGIN@5 # spent 2µs making 1 call to bytes::import
6
7356µs3351µs
# spent 184µs (17+167) within IO::Compress::Adapter::Bzip2::BEGIN@7 which was called: # once (17µs+167µs) by IO::Compress::Bzip2::BEGIN@11 at line 7
use IO::Compress::Base::Common 2.074 qw(:Status);
# spent 184µs making 1 call to IO::Compress::Adapter::Bzip2::BEGIN@7 # spent 155µs making 1 call to Exporter::import # spent 12µs making 1 call to version::_VERSION
8
93693µs3250µs
# spent 134µs (18+116) within IO::Compress::Adapter::Bzip2::BEGIN@9 which was called: # once (18µs+116µs) by IO::Compress::Bzip2::BEGIN@11 at line 9
use Compress::Raw::Bzip2 2.074 ;
# spent 134µs making 1 call to IO::Compress::Adapter::Bzip2::BEGIN@9 # spent 107µs making 1 call to Exporter::import # spent 9µs making 1 call to version::_VERSION
10
11our ($VERSION);
1211µs$VERSION = '2.074';
13
14sub mkCompObject
15{
16 my $BlockSize100K = shift ;
17 my $WorkFactor = shift ;
18 my $Verbosity = shift ;
19
20 $BlockSize100K = 1 if ! defined $BlockSize100K ;
21 $WorkFactor = 0 if ! defined $WorkFactor ;
22 $Verbosity = 0 if ! defined $Verbosity ;
23
24 my ($def, $status) = new Compress::Raw::Bzip2(1, $BlockSize100K,
25 $WorkFactor, $Verbosity);
26
27 return (undef, "Could not create Deflate object: $status", $status)
28 if $status != BZ_OK ;
29
30 return bless {'Def' => $def,
31 'Error' => '',
32 'ErrorNo' => 0,
33 } ;
34}
35
36sub compr
37{
38 my $self = shift ;
39
40 my $def = $self->{Def};
41
42 my $status = $def->bzdeflate($_[0], $_[1]) ;
43 $self->{ErrorNo} = $status;
44
45 if ($status != BZ_RUN_OK)
46 {
47 $self->{Error} = "Deflate Error: $status";
48 return STATUS_ERROR;
49 }
50
51 return STATUS_OK;
52}
53
54sub flush
55{
56 my $self = shift ;
57
58 my $def = $self->{Def};
59
60 my $status = $def->bzflush($_[0]);
61 $self->{ErrorNo} = $status;
62
63 if ($status != BZ_RUN_OK)
64 {
65 $self->{Error} = "Deflate Error: $status";
66 return STATUS_ERROR;
67 }
68
69 return STATUS_OK;
70
71}
72
73sub close
74{
75 my $self = shift ;
76
77 my $def = $self->{Def};
78
79 my $status = $def->bzclose($_[0]);
80 $self->{ErrorNo} = $status;
81
82 if ($status != BZ_STREAM_END)
83 {
84 $self->{Error} = "Deflate Error: $status";
85 return STATUS_ERROR;
86 }
87
88 return STATUS_OK;
89
90}
91
92
93sub reset
94{
95 my $self = shift ;
96
97 my $outer = $self->{Outer};
98
99 my ($def, $status) = new Compress::Raw::Bzip2();
100 $self->{ErrorNo} = ($status == BZ_OK) ? 0 : $status ;
101
102 if ($status != BZ_OK)
103 {
104 $self->{Error} = "Cannot create Deflate object: $status";
105 return STATUS_ERROR;
106 }
107
108 $self->{Def} = $def;
109
110 return STATUS_OK;
111}
112
113sub compressedBytes
114{
115 my $self = shift ;
116 $self->{Def}->compressedBytes();
117}
118
119sub uncompressedBytes
120{
121 my $self = shift ;
122 $self->{Def}->uncompressedBytes();
123}
124
125#sub total_out
126#{
127# my $self = shift ;
128# 0;
129#}
130#
131
132#sub total_in
133#{
134# my $self = shift ;
135# $self->{Def}->total_in();
136#}
137#
138#sub crc32
139#{
140# my $self = shift ;
141# $self->{Def}->crc32();
142#}
143#
144#sub adler32
145#{
146# my $self = shift ;
147# $self->{Def}->adler32();
148#}
149
150
15115µs1;
152
153__END__