← 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/Uncompress/Bunzip2.pm
StatementsExecuted 22 statements in 1.82ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.30ms8.90msIO::Uncompress::Bunzip2::::BEGIN@10IO::Uncompress::Bunzip2::BEGIN@10
11146µs51µsIO::Uncompress::Bunzip2::::BEGIN@3IO::Uncompress::Bunzip2::BEGIN@3
11129µs61µsIO::Uncompress::Bunzip2::::BEGIN@9IO::Uncompress::Bunzip2::BEGIN@9
11122µs258µsIO::Uncompress::Bunzip2::::BEGIN@7IO::Uncompress::Bunzip2::BEGIN@7
11116µs24µsIO::Uncompress::Bunzip2::::BEGIN@5IO::Uncompress::Bunzip2::BEGIN@5
11112µs24µsIO::Uncompress::Bunzip2::::BEGIN@4IO::Uncompress::Bunzip2::BEGIN@4
0000s0sIO::Uncompress::Bunzip2::::bunzip2IO::Uncompress::Bunzip2::bunzip2
0000s0sIO::Uncompress::Bunzip2::::chkTrailerIO::Uncompress::Bunzip2::chkTrailer
0000s0sIO::Uncompress::Bunzip2::::ckMagicIO::Uncompress::Bunzip2::ckMagic
0000s0sIO::Uncompress::Bunzip2::::ckParamsIO::Uncompress::Bunzip2::ckParams
0000s0sIO::Uncompress::Bunzip2::::getExtraParamsIO::Uncompress::Bunzip2::getExtraParams
0000s0sIO::Uncompress::Bunzip2::::isBzip2MagicIO::Uncompress::Bunzip2::isBzip2Magic
0000s0sIO::Uncompress::Bunzip2::::mkUncompIO::Uncompress::Bunzip2::mkUncomp
0000s0sIO::Uncompress::Bunzip2::::newIO::Uncompress::Bunzip2::new
0000s0sIO::Uncompress::Bunzip2::::readHeaderIO::Uncompress::Bunzip2::readHeader
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package IO::Uncompress::Bunzip2 ;
2
3242µs256µs
# spent 51µs (46+5) within IO::Uncompress::Bunzip2::BEGIN@3 which was called: # once (46µs+5µs) by Archive::Tar::Constant::BEGIN@74 at line 3
use strict ;
# spent 51µs making 1 call to IO::Uncompress::Bunzip2::BEGIN@3 # spent 5µs making 1 call to strict::import
4235µs236µs
# spent 24µs (12+12) within IO::Uncompress::Bunzip2::BEGIN@4 which was called: # once (12µs+12µs) by Archive::Tar::Constant::BEGIN@74 at line 4
use warnings;
# spent 24µs making 1 call to IO::Uncompress::Bunzip2::BEGIN@4 # spent 12µs making 1 call to warnings::import
5253µs232µs
# spent 24µs (16+8) within IO::Uncompress::Bunzip2::BEGIN@5 which was called: # once (16µs+8µs) by Archive::Tar::Constant::BEGIN@74 at line 5
use bytes;
# spent 24µs making 1 call to IO::Uncompress::Bunzip2::BEGIN@5 # spent 8µs making 1 call to bytes::import
6
7373µs3494µs
# spent 258µs (22+236) within IO::Uncompress::Bunzip2::BEGIN@7 which was called: # once (22µs+236µs) by Archive::Tar::Constant::BEGIN@74 at line 7
use IO::Compress::Base::Common 2.074 qw(:Status );
# spent 258µs making 1 call to IO::Uncompress::Bunzip2::BEGIN@7 # spent 220µs making 1 call to Exporter::import # spent 16µs making 1 call to version::_VERSION
8
9384µs393µs
# spent 61µs (29+32) within IO::Uncompress::Bunzip2::BEGIN@9 which was called: # once (29µs+32µs) by Archive::Tar::Constant::BEGIN@74 at line 9
use IO::Uncompress::Base 2.074 ;
# spent 61µs making 1 call to IO::Uncompress::Bunzip2::BEGIN@9 # spent 22µs making 1 call to Exporter::import # spent 10µs making 1 call to version::_VERSION
1031.49ms28.91ms
# spent 8.90ms (1.30+7.60) within IO::Uncompress::Bunzip2::BEGIN@10 which was called: # once (1.30ms+7.60ms) by Archive::Tar::Constant::BEGIN@74 at line 10
use IO::Uncompress::Adapter::Bunzip2 2.074 ;
# spent 8.90ms making 1 call to IO::Uncompress::Bunzip2::BEGIN@10 # spent 12µs making 1 call to version::_VERSION
11
1211µsrequire Exporter ;
13our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error);
14
1511µs$VERSION = '2.074';
1610s$Bunzip2Error = '';
17
18129µs@ISA = qw(IO::Uncompress::Base Exporter);
1911µs@EXPORT_OK = qw( $Bunzip2Error bunzip2 ) ;
20#%EXPORT_TAGS = %IO::Uncompress::Base::EXPORT_TAGS ;
2112µspush @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
22#Exporter::export_ok_tags('all');
23
24
25sub new
26{
27 my $class = shift ;
28 my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$Bunzip2Error);
29
30 $obj->_create(undef, 0, @_);
31}
32
33sub bunzip2
34{
35 my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bunzip2Error);
36 return $obj->_inf(@_);
37}
38
39sub getExtraParams
40{
41 return (
42 'verbosity' => [IO::Compress::Base::Common::Parse_boolean, 0],
43 'small' => [IO::Compress::Base::Common::Parse_boolean, 0],
44 );
45}
46
47
48sub ckParams
49{
50 my $self = shift ;
51 my $got = shift ;
52
53 return 1;
54}
55
56sub mkUncomp
57{
58 my $self = shift ;
59 my $got = shift ;
60
61 my $magic = $self->ckMagic()
62 or return 0;
63
64 *$self->{Info} = $self->readHeader($magic)
65 or return undef ;
66
67 my $Small = $got->getValue('small');
68 my $Verbosity = $got->getValue('verbosity');
69
70 my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Bunzip2::mkUncompObject(
71 $Small, $Verbosity);
72
73 return $self->saveErrorString(undef, $errstr, $errno)
74 if ! defined $obj;
75
76 *$self->{Uncomp} = $obj;
77
78 return 1;
79
80}
81
82
83sub ckMagic
84{
85 my $self = shift;
86
87 my $magic ;
88 $self->smartReadExact(\$magic, 4);
89
90 *$self->{HeaderPending} = $magic ;
91
92 return $self->HeaderError("Header size is " .
93 4 . " bytes")
94 if length $magic != 4;
95
96 return $self->HeaderError("Bad Magic.")
97 if ! isBzip2Magic($magic) ;
98
99
100 *$self->{Type} = 'bzip2';
101 return $magic;
102}
103
104sub readHeader
105{
106 my $self = shift;
107 my $magic = shift ;
108
109 $self->pushBack($magic);
110 *$self->{HeaderPending} = '';
111
112
113 return {
114 'Type' => 'bzip2',
115 'FingerprintLength' => 4,
116 'HeaderLength' => 4,
117 'TrailerLength' => 0,
118 'Header' => '$magic'
119 };
120
121}
122
123sub chkTrailer
124{
125 return STATUS_OK;
126}
127
- -
130sub isBzip2Magic
131{
132 my $buffer = shift ;
133 return $buffer =~ /^BZh\d$/;
134}
135
136111µs1 ;
137
138__END__