← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:23:23 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/aliased.pm
StatementsExecuted 125 statements in 1.47ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
611391µs699msaliased::::_load_aliasaliased::_load_alias (recurses: max depth 2, inclusive time 333ms)
611155µs230µsaliased::::_make_aliasaliased::_make_alias
66390µs699msaliased::::importaliased::import (recurses: max depth 2, inclusive time 333ms)
61141µs75µsaliased::::_get_aliasaliased::_get_alias
61135µs35µsaliased::::CORE:substaliased::CORE:subst (opcode)
11111µs13µsaliased::::BEGIN@8aliased::BEGIN@8
1115µs14µsaliased::::BEGIN@35aliased::BEGIN@35
0000s0saliased::::__ANON__[:36]aliased::__ANON__[:36]
0000s0saliased::::aliasaliased::alias
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package aliased;
21400ns$VERSION = '0.30';
3
41505µsrequire Exporter;
518µs@ISA = qw(Exporter);
61600ns@EXPORT = qw(alias);
7
83131µs215µs
# spent 13µs (11+2) within aliased::BEGIN@8 which was called: # once (11µs+2µs) by main::BEGIN@10 at line 8
use strict;
# spent 13µs making 1 call to aliased::BEGIN@8 # spent 2µs making 1 call to strict::import
9
10
# spent 699ms (90µs+699) within aliased::import which was called 6 times, avg 117ms/call: # once (11µs+695ms) by main::BEGIN@10 at line 10 of xt/tapper-mcp-scheduler-with-db-longrun.t # once (9µs+3.56ms) by main::BEGIN@12 at line 12 of xt/tapper-mcp-scheduler-with-db-longrun.t # once (7µs+69µs) by main::BEGIN@11 at line 11 of xt/tapper-mcp-scheduler-with-db-longrun.t # once (17µs+-17µs) by Tapper::MCP::Scheduler::Controller::BEGIN@10 at line 10 of lib/Tapper/MCP/Scheduler/Controller.pm # once (31µs+-31µs) by Tapper::MCP::Scheduler::Controller::BEGIN@9 at line 9 of lib/Tapper/MCP/Scheduler/Controller.pm # once (15µs+-15µs) by Tapper::MCP::Scheduler::PrioQueue::BEGIN@9 at line 9 of lib/Tapper/MCP/Scheduler/PrioQueue.pm
sub import {
11611µs my ( $class, $package, $alias, @import ) = @_;
12
1366µs if ( @_ <= 1 ) {
14 $class->export_to_level(1);
15 return;
16 }
17
1866µs my $callpack = caller(0);
19
20618µs6699ms _load_alias( $package, $callpack, @import );
# spent 1.03s making 6 calls to aliased::_load_alias, avg 172ms/call, recursion: max depth 2, sum of overlapping time 333ms
21646µs6230µs _make_alias( $package, $callpack, $alias );
# spent 230µs making 6 calls to aliased::_make_alias, avg 38µs/call
22}
23
24
# spent 75µs (41+35) within aliased::_get_alias which was called 6 times, avg 13µs/call: # 6 times (41µs+35µs) by aliased::_make_alias at line 33, avg 13µs/call
sub _get_alias {
2564µs my $package = shift;
26658µs635µs $package =~ s/.*(?:::|')//;
# spent 35µs making 6 calls to aliased::CORE:subst, avg 6µs/call
27622µs return $package;
28}
29
30
# spent 230µs (155+75) within aliased::_make_alias which was called 6 times, avg 38µs/call: # 6 times (155µs+75µs) by aliased::import at line 21, avg 38µs/call
sub _make_alias {
31610µs my ( $package, $callpack, $alias ) = @_;
32
33614µs675µs $alias ||= _get_alias($package);
# spent 75µs making 6 calls to aliased::_get_alias, avg 13µs/call
34
353147µs222µs
# spent 14µs (5+8) within aliased::BEGIN@35 which was called: # once (5µs+8µs) by main::BEGIN@10 at line 35
no strict 'refs';
# spent 14µs making 1 call to aliased::BEGIN@35 # spent 8µs making 1 call to strict::unimport
366128µs *{ join q{::} => $callpack, $alias } = sub () { $package };
37}
38
39
# spent 699ms (391µs+699) within aliased::_load_alias which was called 6 times, avg 116ms/call: # 6 times (391µs+699ms) by aliased::import at line 20, avg 116ms/call
sub _load_alias {
4067µs my ( $package, $callpack, @import ) = @_;
41
42 # We don't localize $SIG{__DIE__} here because we need to be careful about
43 # restoring its value if there is a failure. Very, very tricky.
44610µs my $sigdie = $SIG{__DIE__};
45 {
461219µs my $code =
47 @import == 0
48 ? "package $callpack; use $package;"
49 : "package $callpack; use $package (\@import)";
506265µs eval $code;
# spent 238µs executing statements in string eval
# includes 629µs spent executing 1 call to 1 sub defined therein. # spent 165µs executing statements in string eval
# includes 1.46ms spent executing 1 call to 1 sub defined therein. # spent 128µs executing statements in string eval
# includes 403µs spent executing 1 call to 1 sub defined therein. # spent 127µs executing statements in string eval
# includes 490µs spent executing 1 call to 1 sub defined therein. # spent 82µs executing statements in string eval
# includes 1.76ms spent executing 1 call to 1 sub defined therein. # spent 12µs executing statements in string eval
# includes 11µs spent executing 1 call to 1 sub defined therein.
5166µs if ( my $error = $@ ) {
52 $SIG{__DIE__} = $sigdie;
53 die $error;
54 }
55613µs $sigdie = $SIG{__DIE__}
56 if defined $SIG{__DIE__};
57 }
58
59 # Make sure a global $SIG{__DIE__} makes it out of the localization.
60631µs $SIG{__DIE__} = $sigdie if defined $sigdie;
61}
62
63sub alias {
64 my ( $package, @import ) = @_;
65
66 my $callpack = scalar caller(0);
67 _load_alias( $package, $callpack, @import );
68
69 return $package;
70}
71
7213µs1;
73__END__
 
# spent 35µs within aliased::CORE:subst which was called 6 times, avg 6µs/call: # 6 times (35µs+0s) by aliased::_get_alias at line 26, avg 6µs/call
sub aliased::CORE:subst; # opcode