| Filename | /home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/x86_64-linux/Data/Structure/Util.pm |
| Statements | Executed 22 statements in 843µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1.93ms | 5.89ms | Data::Structure::Util::BEGIN@8 |
| 1 | 1 | 1 | 770µs | 1.17ms | Data::Structure::Util::BEGIN@9 |
| 1 | 1 | 1 | 34µs | 34µs | Data::Structure::Util::unbless_xs (xsub) |
| 1 | 1 | 1 | 28µs | 28µs | Data::Structure::Util::bootstrap (xsub) |
| 1 | 1 | 1 | 19µs | 53µs | Data::Structure::Util::unbless |
| 1 | 1 | 1 | 17µs | 17µs | Data::Structure::Util::BEGIN@3 |
| 1 | 1 | 1 | 8µs | 60µs | Data::Structure::Util::BEGIN@7 |
| 1 | 1 | 1 | 7µs | 81µs | Data::Structure::Util::BEGIN@6 |
| 1 | 1 | 1 | 7µs | 18µs | Data::Structure::Util::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | Data::Structure::Util::_utf8_off |
| 0 | 0 | 0 | 0s | 0s | Data::Structure::Util::_utf8_on |
| 0 | 0 | 0 | 0s | 0s | Data::Structure::Util::circular_off |
| 0 | 0 | 0 | 0s | 0s | Data::Structure::Util::get_blessed |
| 0 | 0 | 0 | 0s | 0s | Data::Structure::Util::get_refs |
| 0 | 0 | 0 | 0s | 0s | Data::Structure::Util::has_circular_ref |
| 0 | 0 | 0 | 0s | 0s | Data::Structure::Util::has_utf8 |
| 0 | 0 | 0 | 0s | 0s | Data::Structure::Util::signature |
| 0 | 0 | 0 | 0s | 0s | Data::Structure::Util::utf8_off |
| 0 | 0 | 0 | 0s | 0s | Data::Structure::Util::utf8_on |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Data::Structure::Util; | ||||
| 2 | |||||
| 3 | 2 | 43µs | 1 | 17µs | # spent 17µs within Data::Structure::Util::BEGIN@3 which was called:
# once (17µs+0s) by Benchmark::Perl::Formance::BEGIN@12 at line 3 # spent 17µs making 1 call to Data::Structure::Util::BEGIN@3 |
| 4 | |||||
| 5 | 2 | 19µs | 2 | 29µs | # spent 18µs (7+11) within Data::Structure::Util::BEGIN@5 which was called:
# once (7µs+11µs) by Benchmark::Perl::Formance::BEGIN@12 at line 5 # spent 18µs making 1 call to Data::Structure::Util::BEGIN@5
# spent 11µs making 1 call to strict::import |
| 6 | 2 | 26µs | 2 | 155µs | # spent 81µs (7+74) within Data::Structure::Util::BEGIN@6 which was called:
# once (7µs+74µs) by Benchmark::Perl::Formance::BEGIN@12 at line 6 # spent 81µs making 1 call to Data::Structure::Util::BEGIN@6
# spent 74µs making 1 call to warnings::register::import |
| 7 | 2 | 22µs | 2 | 112µs | # spent 60µs (8+52) within Data::Structure::Util::BEGIN@7 which was called:
# once (8µs+52µs) by Benchmark::Perl::Formance::BEGIN@12 at line 7 # spent 60µs making 1 call to Data::Structure::Util::BEGIN@7
# spent 52µs making 1 call to vars::import |
| 8 | 2 | 133µs | 2 | 5.97ms | # spent 5.89ms (1.93+3.96) within Data::Structure::Util::BEGIN@8 which was called:
# once (1.93ms+3.96ms) by Benchmark::Perl::Formance::BEGIN@12 at line 8 # spent 5.89ms making 1 call to Data::Structure::Util::BEGIN@8
# spent 79µs making 1 call to Exporter::import |
| 9 | 2 | 399µs | 2 | 1.21ms | # spent 1.17ms (770µs+398µs) within Data::Structure::Util::BEGIN@9 which was called:
# once (770µs+398µs) by Benchmark::Perl::Formance::BEGIN@12 at line 9 # spent 1.17ms making 1 call to Data::Structure::Util::BEGIN@9
# spent 42µs making 1 call to Exporter::import |
| 10 | |||||
| 11 | 1 | 600ns | require Exporter; | ||
| 12 | 1 | 62µs | require DynaLoader; | ||
| 13 | 1 | 59µs | require AutoLoader; | ||
| 14 | |||||
| 15 | 1 | 9µs | @ISA = qw( Exporter DynaLoader ); | ||
| 16 | |||||
| 17 | 1 | 400ns | $VERSION = '0.15'; | ||
| 18 | |||||
| 19 | 1 | 1µs | @EXPORT_OK = qw( | ||
| 20 | unbless get_blessed get_refs has_circular_ref circular_off signature | ||||
| 21 | ); | ||||
| 22 | |||||
| 23 | 1 | 2µs | if ( $] >= 5.008 ) { | ||
| 24 | push @EXPORT_OK, qw( | ||||
| 25 | has_utf8 utf8_off utf8_on _utf8_on _utf8_off | ||||
| 26 | ); | ||||
| 27 | } | ||||
| 28 | |||||
| 29 | 1 | 5µs | 1 | 194µs | bootstrap Data::Structure::Util $VERSION; # spent 194µs making 1 call to DynaLoader::bootstrap |
| 30 | |||||
| 31 | sub has_utf8 { | ||||
| 32 | has_utf8_xs( $_[0] ) ? $_[0] : undef; | ||||
| 33 | } | ||||
| 34 | |||||
| 35 | sub utf8_off { | ||||
| 36 | utf8_off_xs( $_[0] ) ? $_[0] : undef; | ||||
| 37 | } | ||||
| 38 | |||||
| 39 | sub utf8_on { | ||||
| 40 | utf8_on_xs( $_[0] ) ? $_[0] : undef; | ||||
| 41 | } | ||||
| 42 | |||||
| 43 | sub _utf8_off { | ||||
| 44 | _utf8_off_xs( $_[0] ) ? $_[0] : undef; | ||||
| 45 | } | ||||
| 46 | |||||
| 47 | sub _utf8_on { | ||||
| 48 | _utf8_on_xs( $_[0] ) ? $_[0] : undef; | ||||
| 49 | } | ||||
| 50 | |||||
| 51 | # spent 53µs (19+34) within Data::Structure::Util::unbless which was called:
# once (19µs+34µs) by Benchmark::Perl::Formance::run at line 664 of lib/Benchmark/Perl/Formance.pm | ||||
| 52 | 1 | 54µs | 1 | 34µs | unbless_xs( $_[0] ); # spent 34µs making 1 call to Data::Structure::Util::unbless_xs |
| 53 | } | ||||
| 54 | |||||
| 55 | sub get_blessed { | ||||
| 56 | $_[0] or return []; | ||||
| 57 | get_blessed_xs( $_[0] ); | ||||
| 58 | } | ||||
| 59 | |||||
| 60 | sub get_refs { | ||||
| 61 | $_[0] or return []; | ||||
| 62 | get_refs_xs( $_[0] ); | ||||
| 63 | } | ||||
| 64 | |||||
| 65 | sub has_circular_ref { | ||||
| 66 | $_[0] or return $_[0]; | ||||
| 67 | has_circular_ref_xs( $_[0] ); | ||||
| 68 | } | ||||
| 69 | |||||
| 70 | # Need to hold another reference to the passed in value to avoid this | ||||
| 71 | # pathological case throwing an error | ||||
| 72 | # my $obj8 = []; | ||||
| 73 | # $obj8->[0] = \$obj8; | ||||
| 74 | # circular_off($obj8); # Used to throw an error | ||||
| 75 | |||||
| 76 | sub circular_off { | ||||
| 77 | my $r = $_[0]; | ||||
| 78 | $r or return $r; | ||||
| 79 | circular_off_xs( $r ); | ||||
| 80 | } | ||||
| 81 | |||||
| 82 | sub signature { | ||||
| 83 | return @_ | ||||
| 84 | ? md5_hex( freeze( [ $_[0], signature_xs( $_[0] ) ] ) ) | ||||
| 85 | : '0' x 32; | ||||
| 86 | } | ||||
| 87 | |||||
| 88 | 1 | 6µs | 1; | ||
| 89 | |||||
| 90 | __END__ | ||||
# spent 28µs within Data::Structure::Util::bootstrap which was called:
# once (28µs+0s) by DynaLoader::bootstrap at line 213 of DynaLoader.pm | |||||
# spent 34µs within Data::Structure::Util::unbless_xs which was called:
# once (34µs+0s) by Data::Structure::Util::unbless at line 52 |