| Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/YAML/PP/Writer.pm |
| Statements | Executed 12 statements in 287µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 30µs | 34µs | YAML::PP::Dumper::BEGIN@2.296 |
| 1 | 1 | 1 | 7µs | 44µs | YAML::PP::Dumper::BEGIN@3 |
| 1 | 1 | 1 | 5µs | 8µs | YAML::PP::Writer::init |
| 1 | 1 | 1 | 4µs | 4µs | YAML::PP::Writer::new |
| 1 | 1 | 1 | 3µs | 3µs | YAML::PP::Writer::set_output |
| 0 | 0 | 0 | 0s | 0s | YAML::PP::Writer::finish |
| 0 | 0 | 0 | 0s | 0s | YAML::PP::Writer::output |
| 0 | 0 | 0 | 0s | 0s | YAML::PP::Writer::write |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # ABSTRACT: Writer class for YAML::PP representing output data | ||||
| 2 | 2 | 33µs | 2 | 38µs | # spent 34µs (30+4) within YAML::PP::Dumper::BEGIN@2.296 which was called:
# once (30µs+4µs) by YAML::PP::Dumper::BEGIN@11 at line 2 # spent 34µs making 1 call to YAML::PP::Dumper::BEGIN@2.296
# spent 4µs making 1 call to strict::import |
| 3 | 2 | 236µs | 2 | 81µs | # spent 44µs (7+37) within YAML::PP::Dumper::BEGIN@3 which was called:
# once (7µs+37µs) by YAML::PP::Dumper::BEGIN@11 at line 3 # spent 44µs making 1 call to YAML::PP::Dumper::BEGIN@3
# spent 37µs making 1 call to warnings::import |
| 4 | package YAML::PP::Writer; | ||||
| 5 | |||||
| 6 | 1 | 0s | our $VERSION = '0.035'; # VERSION | ||
| 7 | |||||
| 8 | sub output { return $_[0]->{output} } | ||||
| 9 | 1 | 5µs | # spent 3µs within YAML::PP::Writer::set_output which was called:
# once (3µ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 | 1µs | $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 8µs (5+3) within YAML::PP::Writer::init which was called:
# once (5µs+3µs) by YAML::PP::Emitter::init at line 60 of YAML/PP/Emitter.pm | ||||
| 26 | 1 | 5µs | 1 | 3µs | $_[0]->set_output(''); # spent 3µ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 | 3µs | 1; | ||
| 35 | |||||
| 36 | __END__ |