| Filename | /home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/x86_64-linux-thread-multi/Data/Structure/Util.pm |
| Statements | Executed 27 statements in 4.98ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 9.39ms | 11.5ms | Data::Structure::Util::BEGIN@8 |
| 1 | 1 | 1 | 3.31ms | 4.78ms | Data::Structure::Util::BEGIN@9 |
| 6 | 1 | 1 | 518µs | 677µs | Data::Structure::Util::unbless |
| 1 | 1 | 1 | 180µs | 180µs | Data::Structure::Util::bootstrap (xsub) |
| 6 | 1 | 1 | 158µs | 158µs | Data::Structure::Util::unbless_xs (xsub) |
| 1 | 1 | 1 | 96µs | 96µs | Data::Structure::Util::BEGIN@3 |
| 1 | 1 | 1 | 37µs | 543µs | Data::Structure::Util::BEGIN@6 |
| 1 | 1 | 1 | 33µs | 289µs | Data::Structure::Util::BEGIN@7 |
| 1 | 1 | 1 | 32µs | 51µ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 | 191µs | 1 | 96µs | # spent 96µs within Data::Structure::Util::BEGIN@3 which was called:
# once (96µs+0s) by main::BEGIN@13 at line 3 # spent 96µs making 1 call to Data::Structure::Util::BEGIN@3 |
| 4 | |||||
| 5 | 2 | 96µs | 2 | 69µs | # spent 51µs (32+18) within Data::Structure::Util::BEGIN@5 which was called:
# once (32µs+18µs) by main::BEGIN@13 at line 5 # spent 51µs making 1 call to Data::Structure::Util::BEGIN@5
# spent 18µs making 1 call to strict::import |
| 6 | 2 | 128µs | 2 | 1.05ms | # spent 543µs (37+507) within Data::Structure::Util::BEGIN@6 which was called:
# once (37µs+507µs) by main::BEGIN@13 at line 6 # spent 543µs making 1 call to Data::Structure::Util::BEGIN@6
# spent 507µs making 1 call to warnings::register::import |
| 7 | 2 | 110µs | 2 | 545µs | # spent 289µs (33+256) within Data::Structure::Util::BEGIN@7 which was called:
# once (33µs+256µs) by main::BEGIN@13 at line 7 # spent 289µs making 1 call to Data::Structure::Util::BEGIN@7
# spent 256µs making 1 call to vars::import |
| 8 | 2 | 781µs | 2 | 11.8ms | # spent 11.5ms (9.39+2.13) within Data::Structure::Util::BEGIN@8 which was called:
# once (9.39ms+2.13ms) by main::BEGIN@13 at line 8 # spent 11.5ms making 1 call to Data::Structure::Util::BEGIN@8
# spent 295µs making 1 call to Exporter::import |
| 9 | 2 | 2.27ms | 2 | 4.98ms | # spent 4.78ms (3.31+1.47) within Data::Structure::Util::BEGIN@9 which was called:
# once (3.31ms+1.47ms) by main::BEGIN@13 at line 9 # spent 4.78ms making 1 call to Data::Structure::Util::BEGIN@9
# spent 197µs making 1 call to Exporter::import |
| 10 | |||||
| 11 | 1 | 2µs | require Exporter; | ||
| 12 | 1 | 397µs | require DynaLoader; | ||
| 13 | 1 | 370µs | require AutoLoader; | ||
| 14 | |||||
| 15 | 1 | 40µs | @ISA = qw( Exporter DynaLoader ); | ||
| 16 | |||||
| 17 | 1 | 3µs | $VERSION = '0.15'; | ||
| 18 | |||||
| 19 | 1 | 9µs | @EXPORT_OK = qw( | ||
| 20 | unbless get_blessed get_refs has_circular_ref circular_off signature | ||||
| 21 | ); | ||||
| 22 | |||||
| 23 | 1 | 14µ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 | 33µs | 1 | 1.13ms | bootstrap Data::Structure::Util $VERSION; # spent 1.13ms 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 677µs (518+159) within Data::Structure::Util::unbless which was called 6 times, avg 113µs/call:
# 6 times (518µs+159µs) by main::check at line 28 of t/app_dpath.t, avg 113µs/call | ||||
| 52 | 6 | 491µs | 6 | 158µs | unbless_xs( $_[0] ); # spent 158µs making 6 calls to Data::Structure::Util::unbless_xs, avg 26µs/call |
| 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 | 48µs | 1; | ||
| 89 | |||||
| 90 | __END__ | ||||
# spent 180µs within Data::Structure::Util::bootstrap which was called:
# once (180µs+0s) by DynaLoader::bootstrap at line 213 of DynaLoader.pm | |||||
# spent 158µs within Data::Structure::Util::unbless_xs which was called 6 times, avg 26µs/call:
# 6 times (158µs+0s) by Data::Structure::Util::unbless at line 52, avg 26µs/call |