| Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/YAML/PP/Writer.pm |
| Statements | Executed 12 statements in 255µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 24µs | 26µs | YAML::PP::Dumper::BEGIN@2.296 |
| 1 | 1 | 1 | 9µs | 11µs | YAML::PP::Writer::init |
| 1 | 1 | 1 | 5µs | 37µs | YAML::PP::Dumper::BEGIN@3 |
| 1 | 1 | 1 | 4µs | 4µs | YAML::PP::Writer::new |
| 1 | 1 | 1 | 2µs | 2µ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 | 29µs | 2 | 28µs | # spent 26µs (24+2) within YAML::PP::Dumper::BEGIN@2.296 which was called:
# once (24µs+2µs) by YAML::PP::Dumper::BEGIN@11 at line 2 # spent 26µs making 1 call to YAML::PP::Dumper::BEGIN@2.296
# spent 2µs making 1 call to strict::import |
| 3 | 2 | 205µs | 2 | 69µs | # spent 37µs (5+32) within YAML::PP::Dumper::BEGIN@3 which was called:
# once (5µs+32µs) by YAML::PP::Dumper::BEGIN@11 at line 3 # spent 37µs making 1 call to YAML::PP::Dumper::BEGIN@3
# spent 32µ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 | 9µ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 | 1µs | 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 11µs (9+2) within YAML::PP::Writer::init which was called:
# once (9µ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 | 3µs | 1; | ||
| 35 | |||||
| 36 | __END__ |