| Filename | /home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Data/DPath.pm |
| Statements | Executed 27 statements in 621µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1.59ms | 5.60ms | Data::DPath::BEGIN@50 |
| 1 | 1 | 1 | 804µs | 47.1ms | Data::DPath::BEGIN@20 |
| 1 | 1 | 1 | 84µs | 2.29ms | Data::DPath::__ANON__[:47] |
| 2 | 1 | 1 | 21µs | 1.65ms | Data::DPath::__ANON__[:27] |
| 1 | 1 | 1 | 10µs | 10µs | Data::DPath::BEGIN@12 |
| 1 | 1 | 1 | 7µs | 11µs | Data::DPath::BEGIN@14 |
| 1 | 1 | 1 | 7µs | 7µs | Data::DPath::BEGIN@4 |
| 1 | 1 | 1 | 6µs | 16µs | Data::DPath::BEGIN@13 |
| 1 | 1 | 1 | 5µs | 5µs | Data::DPath::BEGIN@21 |
| 1 | 1 | 1 | 3µs | 3µs | Data::DPath::build_dpath |
| 1 | 1 | 1 | 2µs | 2µs | Data::DPath::build_dpathi |
| 0 | 0 | 0 | 0s | 0s | Data::DPath::__ANON__[:34] |
| 0 | 0 | 0 | 0s | 0s | Data::DPath::build_dpathr |
| 0 | 0 | 0 | 0s | 0s | Data::DPath::match |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Data::DPath; | ||||
| 2 | # git description: v0.48-1-g9544ca0 | ||||
| 3 | |||||
| 4 | # spent 7µs within Data::DPath::BEGIN@4 which was called:
# once (7µs+0s) by Benchmark::Perl::Formance::BEGIN@17 at line 6 | ||||
| 5 | 1 | 6µs | $Data::DPath::AUTHORITY = 'cpan:SCHWIGON'; | ||
| 6 | 1 | 21µs | 1 | 7µs | } # spent 7µs making 1 call to Data::DPath::BEGIN@4 |
| 7 | { | ||||
| 8 | 2 | 900ns | $Data::DPath::VERSION = '0.49'; | ||
| 9 | } | ||||
| 10 | # ABSTRACT: DPath is not XPath! | ||||
| 11 | |||||
| 12 | 2 | 35µs | 1 | 10µs | # spent 10µs within Data::DPath::BEGIN@12 which was called:
# once (10µs+0s) by Benchmark::Perl::Formance::BEGIN@17 at line 12 # spent 10µs making 1 call to Data::DPath::BEGIN@12 |
| 13 | 2 | 18µs | 2 | 25µs | # spent 16µs (6+10) within Data::DPath::BEGIN@13 which was called:
# once (6µs+10µs) by Benchmark::Perl::Formance::BEGIN@17 at line 13 # spent 16µs making 1 call to Data::DPath::BEGIN@13
# spent 10µs making 1 call to strict::import |
| 14 | 2 | 37µs | 2 | 15µs | # spent 11µs (7+4) within Data::DPath::BEGIN@14 which was called:
# once (7µs+4µs) by Benchmark::Perl::Formance::BEGIN@17 at line 14 # spent 11µs making 1 call to Data::DPath::BEGIN@14
# spent 4µs making 1 call to warnings::import |
| 15 | |||||
| 16 | 1 | 200ns | our $DEBUG = 0; | ||
| 17 | 1 | 100ns | our $USE_SAFE = 1; | ||
| 18 | 1 | 400ns | our $PARALLELIZE = 0; | ||
| 19 | |||||
| 20 | 2 | 77µs | 1 | 47.1ms | # spent 47.1ms (804µs+46.3) within Data::DPath::BEGIN@20 which was called:
# once (804µs+46.3ms) by Benchmark::Perl::Formance::BEGIN@17 at line 20 # spent 47.1ms making 1 call to Data::DPath::BEGIN@20 |
| 21 | 2 | 150µs | 1 | 5µs | # spent 5µs within Data::DPath::BEGIN@21 which was called:
# once (5µs+0s) by Benchmark::Perl::Formance::BEGIN@17 at line 21 # spent 5µs making 1 call to Data::DPath::BEGIN@21 |
| 22 | |||||
| 23 | # spent 3µs within Data::DPath::build_dpath which was called:
# once (3µs+0s) by Sub::Exporter::default_generator at line 419 of Sub/Exporter.pm | ||||
| 24 | # spent 1.65ms (21µs+1.63) within Data::DPath::__ANON__[/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Data/DPath.pm:27] which was called 2 times, avg 824µs/call:
# 2 times (21µs+1.63ms) by Benchmark::Perl::Formance::print_outstyle_summary at line 725 of lib/Benchmark/Perl/Formance.pm, avg 824µs/call | ||||
| 25 | 2 | 2µs | my ($path_str) = @_; | ||
| 26 | 2 | 18µs | 2 | 1.63ms | Data::DPath::Path->new(path => $path_str); # spent 1.63ms making 2 calls to Data::DPath::Path::new, avg 813µs/call |
| 27 | 1 | 5µs | }; | ||
| 28 | } | ||||
| 29 | |||||
| 30 | sub build_dpathr { | ||||
| 31 | return sub ($) { | ||||
| 32 | my ($path_str) = @_; | ||||
| 33 | Data::DPath::Path->new(path => $path_str, give_references => 1); | ||||
| 34 | }; | ||||
| 35 | } | ||||
| 36 | |||||
| 37 | # spent 2µs within Data::DPath::build_dpathi which was called:
# once (2µs+0s) by Sub::Exporter::default_generator at line 419 of Sub/Exporter.pm | ||||
| 38 | # spent 2.29ms (84µs+2.21) within Data::DPath::__ANON__[/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Data/DPath.pm:47] which was called:
# once (84µs+2.21ms) by Benchmark::Perl::Formance::find_interesting_result_paths at line 698 of lib/Benchmark/Perl/Formance.pm | ||||
| 39 | 1 | 2µs | my ($data, $path_str) = @_; | ||
| 40 | |||||
| 41 | 1 | 113µs | 8 | 2.21ms | Data::DPath::Context # spent 1.25ms making 1 call to Data::DPath::Context::_iter
# spent 441µs making 1 call to Iterator::value
# spent 410µs making 1 call to Data::DPath::Path::new
# spent 64µs making 1 call to Data::DPath::Context::_search
# spent 24µs making 1 call to Data::DPath::Context::new
# spent 8µs making 1 call to Data::DPath::Point::new
# spent 6µs making 1 call to Data::DPath::Point::ref
# spent 4µs making 1 call to Data::DPath::Context::current_points |
| 42 | ->new | ||||
| 43 | ->current_points([ Data::DPath::Point->new->ref(\$data) ]) | ||||
| 44 | ->_search(Data::DPath::Path->new(path => "/")) | ||||
| 45 | ->_iter | ||||
| 46 | ->value; # there is always exactly one root "/" | ||||
| 47 | 1 | 4µs | }; | ||
| 48 | } | ||||
| 49 | |||||
| 50 | 1 | 9µs | 1 | 290µs | # spent 5.60ms (1.59+4.01) within Data::DPath::BEGIN@50 which was called:
# once (1.59ms+4.01ms) by Benchmark::Perl::Formance::BEGIN@17 at line 56 # spent 290µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337] |
| 51 | exports => [ dpath => \&build_dpath, | ||||
| 52 | dpathr => \&build_dpathr, | ||||
| 53 | dpathi => \&build_dpathi, | ||||
| 54 | ], | ||||
| 55 | groups => { all => [ 'dpath', 'dpathr' ] }, | ||||
| 56 | 1 | 120µs | 1 | 5.60ms | }; # spent 5.60ms making 1 call to Data::DPath::BEGIN@50 |
| 57 | |||||
| 58 | sub match { | ||||
| 59 | my ($class, $data, $path_str) = @_; | ||||
| 60 | Data::DPath::Path->new(path => $path_str)->match($data); | ||||
| 61 | } | ||||
| 62 | |||||
| 63 | # ------------------------------------------------------------ | ||||
| 64 | |||||
| 65 | 1 | 3µs | 1; | ||
| 66 | |||||
| 67 | __END__ |