Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/YAML/PP/Writer.pm |
Statements | Executed 12 statements in 316µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 34µs | 40µs | BEGIN@2.297 | YAML::PP::Dumper::
1 | 1 | 1 | 9µs | 47µs | BEGIN@3 | YAML::PP::Dumper::
1 | 1 | 1 | 4µs | 6µs | init | YAML::PP::Writer::
1 | 1 | 1 | 4µs | 4µs | new | YAML::PP::Writer::
1 | 1 | 1 | 2µs | 2µs | set_output | YAML::PP::Writer::
0 | 0 | 0 | 0s | 0s | finish | YAML::PP::Writer::
0 | 0 | 0 | 0s | 0s | output | YAML::PP::Writer::
0 | 0 | 0 | 0s | 0s | write | YAML::PP::Writer::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # ABSTRACT: Writer class for YAML::PP representing output data | ||||
2 | 2 | 40µs | 2 | 46µs | # spent 40µs (34+6) within YAML::PP::Dumper::BEGIN@2.297 which was called:
# once (34µs+6µs) by YAML::PP::Dumper::BEGIN@11 at line 2 # spent 40µs making 1 call to YAML::PP::Dumper::BEGIN@2.297
# spent 6µs making 1 call to strict::import |
3 | 2 | 260µs | 2 | 85µs | # spent 47µs (9+38) within YAML::PP::Dumper::BEGIN@3 which was called:
# once (9µs+38µs) by YAML::PP::Dumper::BEGIN@11 at line 3 # spent 47µs making 1 call to YAML::PP::Dumper::BEGIN@3
# spent 38µs making 1 call to warnings::import |
4 | package YAML::PP::Writer; | ||||
5 | |||||
6 | 1 | 1µs | our $VERSION = '0.035'; # VERSION | ||
7 | |||||
8 | sub output { return $_[0]->{output} } | ||||
9 | 1 | 3µs | # spent 2µs within YAML::PP::Writer::set_output which was called:
# once (2µs+0s) by YAML::PP::Writer::init at line 26 | ||
10 | |||||
11 | # spent 4µs within YAML::PP::Writer::new which was called:
# once (4µs+0s) by YAML::PP::Emitter::init at line 51 of YAML/PP/Emitter.pm | ||||
12 | 1 | 0s | my ($class, %args) = @_; | ||
13 | 1 | 0s | my $output = delete $args{output}; | ||
14 | 1 | 0s | $output = '' unless defined $output; | ||
15 | 1 | 4µs | return bless { | ||
16 | output => $output, | ||||
17 | }, $class; | ||||
18 | } | ||||
19 | |||||
20 | sub write { | ||||
21 | my ($self, $line) = @_; | ||||
22 | $self->{output} .= $line; | ||||
23 | } | ||||
24 | |||||
25 | # spent 6µs (4+2) within YAML::PP::Writer::init which was called:
# once (4µs+2µs) by YAML::PP::Emitter::init at line 60 of YAML/PP/Emitter.pm | ||||
26 | 1 | 4µs | 1 | 2µs | $_[0]->set_output(''); # spent 2µs making 1 call to YAML::PP::Writer::set_output |
27 | } | ||||
28 | |||||
29 | sub finish { | ||||
30 | my ($self) = @_; | ||||
31 | $_[0]->set_output(undef); | ||||
32 | } | ||||
33 | |||||
34 | 1 | 4µs | 1; | ||
35 | |||||
36 | __END__ |