← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Wed Dec 14 15:57:08 2022
Reported on Wed Dec 14 16:00:37 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/YAML/PP/Writer/File.pm
StatementsExecuted 12 statements in 621µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11142µs45µsYAML::PP::Dumper::::BEGIN@1.297 YAML::PP::Dumper::BEGIN@1.297
11124µs118µsYAML::PP::Writer::File::::BEGIN@7YAML::PP::Writer::File::BEGIN@7
11119µs48µsYAML::PP::Writer::File::::BEGIN@11YAML::PP::Writer::File::BEGIN@11
11110µs100µsYAML::PP::Writer::File::::BEGIN@9YAML::PP::Writer::File::BEGIN@9
1119µs45µsYAML::PP::Dumper::::BEGIN@2.298 YAML::PP::Dumper::BEGIN@2.298
5519µs9µsYAML::PP::Dumper::::__ANON__ YAML::PP::Dumper::__ANON__ (xsub)
0000s0sYAML::PP::Writer::File::::_open_handleYAML::PP::Writer::File::_open_handle
0000s0sYAML::PP::Writer::File::::finishYAML::PP::Writer::File::finish
0000s0sYAML::PP::Writer::File::::initYAML::PP::Writer::File::init
0000s0sYAML::PP::Writer::File::::writeYAML::PP::Writer::File::write
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1238µs248µs
# spent 45µs (42+3) within YAML::PP::Dumper::BEGIN@1.297 which was called: # once (42µs+3µs) by YAML::PP::Dumper::BEGIN@12 at line 1
use strict;
# spent 45µs making 1 call to YAML::PP::Dumper::BEGIN@1.297 # spent 3µs making 1 call to strict::import
2269µs281µs
# spent 45µs (9+36) within YAML::PP::Dumper::BEGIN@2.298 which was called: # once (9µs+36µs) by YAML::PP::Dumper::BEGIN@12 at line 2
use warnings;
# spent 45µs making 1 call to YAML::PP::Dumper::BEGIN@2.298 # spent 36µs making 1 call to warnings::import
3package YAML::PP::Writer::File;
4
510sour $VERSION = '0.035'; # VERSION
6
72153µs2212µs
# spent 118µs (24+94) within YAML::PP::Writer::File::BEGIN@7 which was called: # once (24µs+94µs) by YAML::PP::Dumper::BEGIN@12 at line 7
use Scalar::Util qw/ openhandle /;
# spent 118µs making 1 call to YAML::PP::Writer::File::BEGIN@7 # spent 94µs making 1 call to Exporter::import
8
9246µs2190µs
# spent 100µs (10+90) within YAML::PP::Writer::File::BEGIN@9 which was called: # once (10µs+90µs) by YAML::PP::Dumper::BEGIN@12 at line 9
use base qw/ YAML::PP::Writer /;
# spent 100µs making 1 call to YAML::PP::Writer::File::BEGIN@9 # spent 90µs making 1 call to base::import
10
112311µs277µs
# spent 48µs (19+29) within YAML::PP::Writer::File::BEGIN@11 which was called: # once (19µs+29µs) by YAML::PP::Dumper::BEGIN@12 at line 11
use Carp qw/ croak /;
# spent 48µs making 1 call to YAML::PP::Writer::File::BEGIN@11 # spent 29µs making 1 call to Exporter::import
12
13sub _open_handle {
14 my ($self) = @_;
15 if (openhandle($self->{output})) {
16 $self->{filehandle} = $self->{output};
17 return $self->{output};
18 }
19 open my $fh, '>:encoding(UTF-8)', $self->{output}
20 or croak "Could not open '$self->{output}' for writing: $!";
21 $self->{filehandle} = $fh;
22 return $fh;
23}
24
25sub write {
26 my ($self, $line) = @_;
27 my $fh = $self->{filehandle};
28 print $fh $line;
29}
30
31sub init {
32 my ($self) = @_;
33 my $fh = $self->_open_handle;
34}
35
36sub finish {
37 my ($self) = @_;
38 if (openhandle($self->{output})) {
39 # Original argument was a file handle, so the caller needs
40 # to close it
41 return;
42 }
43 close $self->{filehandle};
44}
45
4614µs1;
47
48__END__
 
# spent 9µs within YAML::PP::Dumper::__ANON__ which was called 5 times, avg 2µs/call: # once (3µs+0s) by YAML::PP::Dumper::BEGIN@10 at line 10 of YAML/PP/Dumper.pm # once (3µs+0s) by YAML::PP::Dumper::BEGIN@9 at line 9 of YAML/PP/Dumper.pm # once (2µs+0s) by YAML::PP::Dumper::BEGIN@12 at line 12 of YAML/PP/Dumper.pm # once (1µs+0s) by YAML::PP::Dumper::BEGIN@11 at line 11 of YAML/PP/Dumper.pm # once (0s+0s) by YAML::PP::Dumper::BEGIN@8 at line 8 of YAML/PP/Dumper.pm
sub YAML::PP::Dumper::__ANON__; # xsub