← Index
NYTProf Performance Profile   « block view • line view • sub view »
For reply.pl
  Run on Thu Oct 21 22:40:13 2010
Reported on Thu Oct 21 22:44:43 2010

Filename/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/x86_64-linux/Sub/Identify.pm
StatementsExecuted 122 statements in 1.46ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
10311596µs798µsSub::Identify::::sub_fullnameSub::Identify::sub_fullname
10311203µs203µsSub::Identify::::get_code_infoSub::Identify::get_code_info (xsub)
11134µs220µsSub::Identify::::BEGIN@6Sub::Identify::BEGIN@6
11125µs30µsSub::Identify::::BEGIN@3Sub::Identify::BEGIN@3
11112µs45µsSub::Identify::::BEGIN@4Sub::Identify::BEGIN@4
0000s0sSub::Identify::::__ANON__[:44]Sub::Identify::__ANON__[:44]
0000s0sSub::Identify::::stash_nameSub::Identify::stash_name
0000s0sSub::Identify::::sub_nameSub::Identify::sub_name
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Sub::Identify;
2
3230µs234µs
# spent 30µs (25+5) within Sub::Identify::BEGIN@3 which was called: # once (25µs+5µs) by namespace::clean::BEGIN@15 at line 3
use strict;
# spent 30µs making 1 call to Sub::Identify::BEGIN@3 # spent 5µs making 1 call to strict::import
42237µs278µs
# spent 45µs (12+33) within Sub::Identify::BEGIN@4 which was called: # once (12µs+33µs) by namespace::clean::BEGIN@15 at line 4
use Exporter;
# spent 45µs making 1 call to Sub::Identify::BEGIN@4 # spent 33µs making 1 call to Exporter::import
5
6
# spent 220µs (34+186) within Sub::Identify::BEGIN@6 which was called: # once (34µs+186µs) by namespace::clean::BEGIN@15 at line 46
BEGIN {
711µs our $VERSION = '0.04';
815µs our @ISA = ('Exporter');
914µs our %EXPORT_TAGS = (all => [ our @EXPORT_OK = qw(sub_name stash_name sub_fullname get_code_info) ]);
10
1111µs my $loaded = 0;
1212µs unless ($ENV{PERL_SUB_IDENTIFY_PP}) {
1311µs local $@;
1412µs eval {
1513µs if ($] >= 5.006) {
1611µs require XSLoader;
171192µs1186µs XSLoader::load(__PACKAGE__, $VERSION);
# spent 186µs making 1 call to XSLoader::load
18 }
19 else {
20 require DynaLoader;
21 push @ISA, 'DynaLoader';
22 __PACKAGE__->bootstrap($VERSION);
23 }
24 };
25
261700ns die $@ if $@ && $@ !~ /object version|loadable object/;
27
2811µs $loaded = 1 unless $@;
29 }
30
3111µs our $IsPurePerl = !$loaded;
32
3314µs if ($IsPurePerl) {
34 require B;
35 *get_code_info = sub ($) {
36 my ($coderef) = @_;
37 ref $coderef or return;
38 my $cv = B::svref_2object($coderef);
39 $cv->isa('B::CV') or return;
40 # bail out if GV is undefined
41 $cv->GV->isa('B::SPECIAL') and return;
42
43 return ($cv->GV->STASH->NAME, $cv->GV->NAME);
44 };
45 }
46182µs1220µs}
# spent 220µs making 1 call to Sub::Identify::BEGIN@6
47
48sub stash_name ($) { (get_code_info($_[0]))[0] }
49sub sub_name ($) { (get_code_info($_[0]))[1] }
50103890µs103203µs
# spent 798µs (596+203) within Sub::Identify::sub_fullname which was called 103 times, avg 8µs/call: # 103 times (596µs+203µs) by namespace::clean::__ANON__[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/namespace/clean.pm:52] at line 43 of namespace/clean.pm, avg 8µs/call
sub sub_fullname ($) { join '::', get_code_info($_[0]) }
# spent 203µs making 103 calls to Sub::Identify::get_code_info, avg 2µs/call
51
5213µs1;
53
54__END__
 
# spent 203µs within Sub::Identify::get_code_info which was called 103 times, avg 2µs/call: # 103 times (203µs+0s) by Sub::Identify::sub_fullname at line 50, avg 2µs/call
sub Sub::Identify::get_code_info; # xsub