Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/aliased.pm |
Statements | Executed 125 statements in 1.47ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
6 | 1 | 1 | 391µs | 699ms | _load_alias (recurses: max depth 2, inclusive time 333ms) | aliased::
6 | 1 | 1 | 155µs | 230µs | _make_alias | aliased::
6 | 6 | 3 | 90µs | 699ms | import (recurses: max depth 2, inclusive time 333ms) | aliased::
6 | 1 | 1 | 41µs | 75µs | _get_alias | aliased::
6 | 1 | 1 | 35µs | 35µs | CORE:subst (opcode) | aliased::
1 | 1 | 1 | 11µs | 13µs | BEGIN@8 | aliased::
1 | 1 | 1 | 5µs | 14µs | BEGIN@35 | aliased::
0 | 0 | 0 | 0s | 0s | __ANON__[:36] | aliased::
0 | 0 | 0 | 0s | 0s | alias | aliased::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package aliased; | ||||
2 | 1 | 400ns | $VERSION = '0.30'; | ||
3 | |||||
4 | 1 | 505µs | require Exporter; | ||
5 | 1 | 8µs | @ISA = qw(Exporter); | ||
6 | 1 | 600ns | @EXPORT = qw(alias); | ||
7 | |||||
8 | 3 | 131µs | 2 | 15µ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 # 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 | ||||
11 | 30 | 87µs | my ( $class, $package, $alias, @import ) = @_; | ||
12 | |||||
13 | if ( @_ <= 1 ) { | ||||
14 | $class->export_to_level(1); | ||||
15 | return; | ||||
16 | } | ||||
17 | |||||
18 | my $callpack = caller(0); | ||||
19 | |||||
20 | 6 | 699ms | _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 | ||
21 | 6 | 230µ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 | ||||
25 | 18 | 83µs | my $package = shift; | ||
26 | 6 | 35µs | $package =~ s/.*(?:::|')//; # spent 35µs making 6 calls to aliased::CORE:subst, avg 6µs/call | ||
27 | 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 | ||||
31 | 18 | 152µs | my ( $package, $callpack, $alias ) = @_; | ||
32 | |||||
33 | 6 | 75µs | $alias ||= _get_alias($package); # spent 75µs making 6 calls to aliased::_get_alias, avg 13µs/call | ||
34 | |||||
35 | 3 | 147µs | 2 | 22µ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 # spent 14µs making 1 call to aliased::BEGIN@35
# spent 8µs making 1 call to strict::unimport |
36 | *{ 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 | ||||
40 | 48 | 350µ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. | ||||
44 | my $sigdie = $SIG{__DIE__}; | ||||
45 | { | ||||
46 | my $code = | ||||
47 | @import == 0 | ||||
48 | ? "package $callpack; use $package;" | ||||
49 | : "package $callpack; use $package (\@import)"; | ||||
50 | 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. | ||||
51 | if ( my $error = $@ ) { | ||||
52 | $SIG{__DIE__} = $sigdie; | ||||
53 | die $error; | ||||
54 | } | ||||
55 | $sigdie = $SIG{__DIE__} | ||||
56 | if defined $SIG{__DIE__}; | ||||
57 | } | ||||
58 | |||||
59 | # Make sure a global $SIG{__DIE__} makes it out of the localization. | ||||
60 | $SIG{__DIE__} = $sigdie if defined $sigdie; | ||||
61 | } | ||||
62 | |||||
63 | sub alias { | ||||
64 | my ( $package, @import ) = @_; | ||||
65 | |||||
66 | my $callpack = scalar caller(0); | ||||
67 | _load_alias( $package, $callpack, @import ); | ||||
68 | |||||
69 | return $package; | ||||
70 | } | ||||
71 | |||||
72 | 1 | 3µs | 1; | ||
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 |