Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm |
Statements | Executed 4062 statements in 3.90ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 2.56ms | 2.72ms | BEGIN@3 | Attribute::Handlers::
44 | 4 | 1 | 1.54ms | 3.12ms | _apply_handler_AH_ | Attribute::Handlers::
12 | 2 | 1 | 1.20ms | 1.20ms | findsym | Attribute::Handlers::
1 | 1 | 1 | 491µs | 746µs | BEGIN@114 | Attribute::Handlers::
1 | 1 | 1 | 271µs | 504µs | BEGIN@6 | Attribute::Handlers::
13 | 1 | 1 | 245µs | 337µs | __ANON__[:199] | Attribute::Handlers::
1 | 1 | 1 | 39µs | 3.07ms | CHECK | Attribute::Handlers::
12 | 1 | 1 | 29µs | 29µs | CORE:match (opcode) | Attribute::Handlers::
1 | 1 | 1 | 27µs | 61µs | END | Attribute::Handlers::
1 | 1 | 1 | 25µs | 57µs | INIT | Attribute::Handlers::
15 | 3 | 1 | 13µs | 13µs | __ANON__[:115] | Attribute::Handlers::
1 | 1 | 1 | 11µs | 22µs | _resolve_lastattr | Attribute::Handlers::
4 | 1 | 1 | 9µs | 9µs | _gen_handler_AH_ | Attribute::Handlers::
1 | 1 | 1 | 8µs | 8µs | BEGIN@2 | Attribute::Handlers::
1 | 1 | 1 | 8µs | 8µs | BEGIN@108 | Attribute::Handlers::
1 | 1 | 1 | 7µs | 11µs | BEGIN@4 | Attribute::Handlers::
1 | 1 | 1 | 6µs | 19µs | BEGIN@219 | Attribute::Handlers::
1 | 1 | 1 | 6µs | 13µs | BEGIN@152 | Attribute::Handlers::
1 | 1 | 1 | 5µs | 13µs | BEGIN@203 | Attribute::Handlers::
1 | 1 | 1 | 5µs | 12µs | BEGIN@240 | Attribute::Handlers::
1 | 1 | 1 | 5µs | 14µs | BEGIN@128 | Attribute::Handlers::
1 | 1 | 1 | 5µs | 12µs | BEGIN@15 | Attribute::Handlers::
1 | 1 | 1 | 5µs | 6µs | BEGIN@21 | Attribute::Handlers::
1 | 1 | 1 | 4µs | 5µs | BEGIN@5 | Attribute::Handlers::
1 | 1 | 1 | 2µs | 2µs | MODIFY_CODE_ATTRIBUTES | Attribute::Handlers::_TEST_::
1 | 1 | 1 | 2µs | 2µs | import | Attribute::Handlers::
2 | 2 | 1 | 2µs | 2µs | CORE:qr (opcode) | Attribute::Handlers::
5 | 5 | 1 | 900ns | 900ns | CORE:subst (opcode) | Attribute::Handlers::
0 | 0 | 0 | 0s | 0s | AUTOLOAD | Attribute::Handlers::
0 | 0 | 0 | 0s | 0s | t | Attribute::Handlers::_TEST_::
0 | 0 | 0 | 0s | 0s | _usage_AH_ | Attribute::Handlers::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Attribute::Handlers; | ||||
2 | 2 | 22µs | 1 | 8µs | # spent 8µs within Attribute::Handlers::BEGIN@2 which was called:
# once (8µs+0s) by App::Rad::Help::BEGIN@2 at line 2 # spent 8µs making 1 call to Attribute::Handlers::BEGIN@2 |
3 | 2 | 66µs | 2 | 2.75ms | # spent 2.72ms (2.56+164µs) within Attribute::Handlers::BEGIN@3 which was called:
# once (2.56ms+164µs) by App::Rad::Help::BEGIN@2 at line 3 # spent 2.72ms making 1 call to Attribute::Handlers::BEGIN@3
# spent 31µs making 1 call to Exporter::import |
4 | 2 | 15µs | 2 | 15µs | # spent 11µs (7+4) within Attribute::Handlers::BEGIN@4 which was called:
# once (7µs+4µs) by App::Rad::Help::BEGIN@2 at line 4 # spent 11µs making 1 call to Attribute::Handlers::BEGIN@4
# spent 4µs making 1 call to warnings::import |
5 | 2 | 14µs | 2 | 6µs | # spent 5µs (4+1000ns) within Attribute::Handlers::BEGIN@5 which was called:
# once (4µs+1000ns) by App::Rad::Help::BEGIN@2 at line 5 # spent 5µs making 1 call to Attribute::Handlers::BEGIN@5
# spent 1µs making 1 call to strict::import |
6 | 2 | 89µs | 2 | 530µs | # spent 504µs (271+233) within Attribute::Handlers::BEGIN@6 which was called:
# once (271µs+233µs) by App::Rad::Help::BEGIN@2 at line 6 # spent 504µs making 1 call to Attribute::Handlers::BEGIN@6
# spent 26µs making 1 call to vars::import |
7 | 1 | 400ns | $VERSION = '0.97'; # remember to update version in POD! | ||
8 | # $DB::single=1; | ||||
9 | |||||
10 | 1 | 100ns | my %symcache; | ||
11 | sub findsym { | ||||
12 | 12 | 5µs | my ($pkg, $ref, $type) = @_; | ||
13 | 12 | 15µs | return $symcache{$pkg,$ref} if $symcache{$pkg,$ref}; | ||
14 | 12 | 4µs | $type ||= ref($ref); | ||
15 | 2 | 44µs | 2 | 18µs | # spent 12µs (5+7) within Attribute::Handlers::BEGIN@15 which was called:
# once (5µs+7µs) by App::Rad::Help::BEGIN@2 at line 15 # spent 12µs making 1 call to Attribute::Handlers::BEGIN@15
# spent 7µs making 1 call to strict::unimport |
16 | 12 | 12µs | my $symtab = \%{$pkg."::"}; | ||
17 | 882 | 539µs | for ( keys %$symtab ) { for my $sym ( $$symtab{$_} ) { | ||
18 | 870 | 160µs | if (ref $sym && $sym == $ref) { | ||
19 | return $symcache{$pkg,$ref} = \*{"$pkg:\:$_"}; | ||||
20 | } | ||||
21 | 2 | 379µs | 2 | 7µs | # spent 6µs (5+1) within Attribute::Handlers::BEGIN@21 which was called:
# once (5µs+1µs) by App::Rad::Help::BEGIN@2 at line 21 # spent 6µs making 1 call to Attribute::Handlers::BEGIN@21
# spent 1µs making 1 call to strict::import |
22 | 861 | 179µs | next unless ref ( \$sym ) eq 'GLOB'; | ||
23 | return $symcache{$pkg,$ref} = \$sym | ||||
24 | 799 | 306µs | if *{$sym}{$type} && *{$sym}{$type} == $ref; | ||
25 | }} | ||||
26 | } | ||||
27 | |||||
28 | 1 | 5µs | my %validtype = ( | ||
29 | VAR => [qw[SCALAR ARRAY HASH]], | ||||
30 | ANY => [qw[SCALAR ARRAY HASH CODE]], | ||||
31 | "" => [qw[SCALAR ARRAY HASH CODE]], | ||||
32 | SCALAR => [qw[SCALAR]], | ||||
33 | ARRAY => [qw[ARRAY]], | ||||
34 | HASH => [qw[HASH]], | ||||
35 | CODE => [qw[CODE]], | ||||
36 | ); | ||||
37 | 1 | 100ns | my %lastattr; | ||
38 | my @declarations; | ||||
39 | my %raw; | ||||
40 | my %phase; | ||||
41 | 1 | 700ns | my %sigil = (SCALAR=>'$', ARRAY=>'@', HASH=>'%'); | ||
42 | 1 | 200ns | my $global_phase = 0; | ||
43 | 1 | 600ns | my %global_phases = ( | ||
44 | BEGIN => 0, | ||||
45 | CHECK => 1, | ||||
46 | INIT => 2, | ||||
47 | END => 3, | ||||
48 | ); | ||||
49 | 1 | 500ns | my @global_phases = qw(BEGIN CHECK INIT END); | ||
50 | |||||
51 | sub _usage_AH_ { | ||||
52 | croak "Usage: use $_[0] autotie => {AttrName => TieClassName,...}"; | ||||
53 | } | ||||
54 | |||||
55 | 1 | 5µs | 1 | 1µs | my $qual_id = qr/^[_a-z]\w*(::[_a-z]\w*)*$/i; # spent 1µs making 1 call to Attribute::Handlers::CORE:qr |
56 | |||||
57 | # spent 2µs within Attribute::Handlers::import which was called:
# once (2µs+0s) by App::Rad::Help::BEGIN@2 at line 2 of App/Rad/Help.pm | ||||
58 | 1 | 400ns | my $class = shift @_; | ||
59 | 1 | 400ns | return unless $class eq "Attribute::Handlers"; | ||
60 | 1 | 2µs | while (@_) { | ||
61 | my $cmd = shift; | ||||
62 | if ($cmd =~ /^autotie((?:ref)?)$/) { | ||||
63 | my $tiedata = ($1 ? '$ref, ' : '') . '@$data'; | ||||
64 | my $mapping = shift; | ||||
65 | _usage_AH_ $class unless ref($mapping) eq 'HASH'; | ||||
66 | while (my($attr, $tieclass) = each %$mapping) { | ||||
67 | $tieclass =~ s/^([_a-z]\w*(::[_a-z]\w*)*)(.*)/$1/is; | ||||
68 | my $args = $3||'()'; | ||||
69 | _usage_AH_ $class unless $attr =~ $qual_id | ||||
70 | && $tieclass =~ $qual_id | ||||
71 | && eval "use base q\0$tieclass\0; 1"; | ||||
72 | if ($tieclass->isa('Exporter')) { | ||||
73 | local $Exporter::ExportLevel = 2; | ||||
74 | $tieclass->import(eval $args); | ||||
75 | } | ||||
76 | $attr =~ s/__CALLER__/caller(1)/e; | ||||
77 | $attr = caller()."::".$attr unless $attr =~ /::/; | ||||
78 | eval qq{ | ||||
79 | sub $attr : ATTR(VAR) { | ||||
80 | my (\$ref, \$data) = \@_[2,4]; | ||||
81 | my \$was_arrayref = ref \$data eq 'ARRAY'; | ||||
82 | \$data = [ \$data ] unless \$was_arrayref; | ||||
83 | my \$type = ref(\$ref)||"value (".(\$ref||"<undef>").")"; | ||||
84 | (\$type eq 'SCALAR')? tie \$\$ref,'$tieclass',$tiedata | ||||
85 | :(\$type eq 'ARRAY') ? tie \@\$ref,'$tieclass',$tiedata | ||||
86 | :(\$type eq 'HASH') ? tie \%\$ref,'$tieclass',$tiedata | ||||
87 | : die "Can't autotie a \$type\n" | ||||
88 | } 1 | ||||
89 | } or die "Internal error: $@"; | ||||
90 | } | ||||
91 | } | ||||
92 | else { | ||||
93 | croak "Can't understand $_"; | ||||
94 | } | ||||
95 | } | ||||
96 | } | ||||
97 | |||||
98 | # On older perls, code attribute handlers run before the sub gets placed | ||||
99 | # in its package. Since the :ATTR handlers need to know the name of the | ||||
100 | # sub they're applied to, the name lookup (via findsym) needs to be | ||||
101 | # delayed: we do it immediately before we might need to find attribute | ||||
102 | # handlers from their name. However, on newer perls (which fix some | ||||
103 | # problems relating to attribute application), a sub gets placed in its | ||||
104 | # package before its attributes are processed. In this case, the | ||||
105 | # delayed name lookup might be too late, because the sub we're looking | ||||
106 | # for might have already been replaced. So we need to detect which way | ||||
107 | # round this perl does things, and time the name lookup accordingly. | ||||
108 | # spent 8µs within Attribute::Handlers::BEGIN@108 which was called:
# once (8µs+0s) by App::Rad::Help::BEGIN@2 at line 118 | ||||
109 | 1 | 100ns | my $delayed; | ||
110 | # spent 2µs within Attribute::Handlers::_TEST_::MODIFY_CODE_ATTRIBUTES which was called:
# once (2µs+0s) by attributes::import at line 68 of attributes.pm | ||||
111 | 1 | 1µs | $delayed = \&Attribute::Handlers::_TEST_::t != $_[1]; | ||
112 | 1 | 2µs | return (); | ||
113 | } | ||||
114 | 2 | 115µs | 2 | 863µs | # spent 746µs (491+255) within Attribute::Handlers::BEGIN@114 which was called:
# once (491µs+255µs) by App::Rad::Help::BEGIN@2 at line 114 # spent 746µs making 1 call to Attribute::Handlers::BEGIN@114
# spent 117µs making 1 call to attributes::import |
115 | 16 | 34µs | # spent 13µs within Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:115] which was called 15 times, avg 860ns/call:
# 13 times (11µs+0s) by Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] at line 146, avg 815ns/call
# once (2µs+0s) by Attribute::Handlers::CHECK at line 243
# once (500ns+0s) by Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] at line 171 | ||
116 | 1 | 2µs | undef &Attribute::Handlers::_TEST_::MODIFY_CODE_ATTRIBUTES; | ||
117 | 1 | 3µs | undef &Attribute::Handlers::_TEST_::t; | ||
118 | 1 | 66µs | 1 | 8µs | } # spent 8µs making 1 call to Attribute::Handlers::BEGIN@108 |
119 | |||||
120 | # spent 22µs (11+11) within Attribute::Handlers::_resolve_lastattr which was called:
# once (11µs+11µs) by Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] at line 171 | ||||
121 | 1 | 300ns | return unless $lastattr{ref}; | ||
122 | 1 | 2µs | 1 | 11µs | my $sym = findsym @lastattr{'pkg','ref'} # spent 11µs making 1 call to Attribute::Handlers::findsym |
123 | or die "Internal error: $lastattr{pkg} symbol went missing"; | ||||
124 | 1 | 400ns | my $name = *{$sym}{NAME}; | ||
125 | 1 | 400ns | warn "Declaration of $name attribute in package $lastattr{pkg} may clash with future reserved word\n" | ||
126 | if $^W and $name !~ /[A-Z]/; | ||||
127 | 1 | 800ns | foreach ( @{$validtype{$lastattr{type}}} ) { | ||
128 | 2 | 208µs | 2 | 22µs | # spent 14µs (5+8) within Attribute::Handlers::BEGIN@128 which was called:
# once (5µs+8µs) by App::Rad::Help::BEGIN@2 at line 128 # spent 14µs making 1 call to Attribute::Handlers::BEGIN@128
# spent 8µs making 1 call to strict::unimport |
129 | 1 | 5µs | *{"$lastattr{pkg}::_ATTR_${_}_${name}"} = $lastattr{ref}; | ||
130 | } | ||||
131 | 1 | 3µs | %lastattr = (); | ||
132 | } | ||||
133 | |||||
134 | sub AUTOLOAD { | ||||
135 | return if $AUTOLOAD =~ /::DESTROY$/; | ||||
136 | my ($class) = $AUTOLOAD =~ m/(.*)::/g; | ||||
137 | $AUTOLOAD =~ m/_ATTR_(.*?)_(.*)/ or | ||||
138 | croak "Can't locate class method '$AUTOLOAD' via package '$class'"; | ||||
139 | croak "Attribute handler '$2' doesn't handle $1 attributes"; | ||||
140 | } | ||||
141 | |||||
142 | 1 | 2µs | 1 | 400ns | my $builtin = qr/lvalue|method|locked|unique|shared/; # spent 400ns making 1 call to Attribute::Handlers::CORE:qr |
143 | |||||
144 | # spent 9µs within Attribute::Handlers::_gen_handler_AH_ which was called 4 times, avg 2µs/call:
# 4 times (9µs+0s) by App::Rad::Help::BEGIN@2 at line 205, avg 2µs/call | ||||
145 | # spent 337µs (245+92) within Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] which was called 13 times, avg 26µs/call:
# 13 times (245µs+92µs) by attributes::import at line 68 of attributes.pm, avg 26µs/call | ||||
146 | 13 | 11µs | 13 | 11µs | _resolve_lastattr if _delayed_name_resolution; # spent 11µs making 13 calls to Attribute::Handlers::__ANON__[Attribute/Handlers.pm:115], avg 815ns/call |
147 | 13 | 14µs | my ($pkg, $ref, @attrs) = @_; | ||
148 | 13 | 29µs | my (undef, $filename, $linenum) = caller 2; | ||
149 | 13 | 7µs | foreach (@attrs) { | ||
150 | 12 | 50µs | 12 | 29µs | my ($attr, $data) = /^([a-z_]\w*)(?:[(](.*)[)])?$/is or next; # spent 29µs making 12 calls to Attribute::Handlers::CORE:match, avg 2µs/call |
151 | 12 | 4µs | if ($attr eq 'ATTR') { | ||
152 | 2 | 258µs | 2 | 20µs | # spent 13µs (6+7) within Attribute::Handlers::BEGIN@152 which was called:
# once (6µs+7µs) by App::Rad::Help::BEGIN@2 at line 152 # spent 13µs making 1 call to Attribute::Handlers::BEGIN@152
# spent 7µs making 1 call to strict::unimport |
153 | 1 | 100ns | $data ||= "ANY"; | ||
154 | 1 | 4µs | 1 | 500ns | $raw{$ref} = $data =~ s/\s*,?\s*RAWDATA\s*,?\s*//; # spent 500ns making 1 call to Attribute::Handlers::CORE:subst |
155 | 1 | 2µs | 1 | 100ns | $phase{$ref}{BEGIN} = 1 # spent 100ns making 1 call to Attribute::Handlers::CORE:subst |
156 | if $data =~ s/\s*,?\s*(BEGIN)\s*,?\s*//; | ||||
157 | 1 | 2µs | 1 | 200ns | $phase{$ref}{INIT} = 1 # spent 200ns making 1 call to Attribute::Handlers::CORE:subst |
158 | if $data =~ s/\s*,?\s*(INIT)\s*,?\s*//; | ||||
159 | 1 | 2µs | 1 | 100ns | $phase{$ref}{END} = 1 # spent 100ns making 1 call to Attribute::Handlers::CORE:subst |
160 | if $data =~ s/\s*,?\s*(END)\s*,?\s*//; | ||||
161 | $phase{$ref}{CHECK} = 1 | ||||
162 | if $data =~ s/\s*,?\s*(CHECK)\s*,?\s*// | ||||
163 | 1 | 3µs | 1 | 0s | || ! keys %{$phase{$ref}}; # spent 0s making 1 call to Attribute::Handlers::CORE:subst |
164 | # Added for cleanup to not pollute next call. | ||||
165 | 1 | 300ns | (%lastattr = ()), | ||
166 | croak "Can't have two ATTR specifiers on one subroutine" | ||||
167 | if keys %lastattr; | ||||
168 | croak "Bad attribute type: ATTR($data)" | ||||
169 | 1 | 300ns | unless $validtype{$data}; | ||
170 | 1 | 1µs | %lastattr=(pkg=>$pkg,ref=>$ref,type=>$data); | ||
171 | 1 | 2µs | 2 | 23µs | _resolve_lastattr unless _delayed_name_resolution; # spent 22µs making 1 call to Attribute::Handlers::_resolve_lastattr
# spent 500ns making 1 call to Attribute::Handlers::__ANON__[Attribute/Handlers.pm:115] |
172 | } | ||||
173 | else { | ||||
174 | 11 | 3µs | my $type = ref $ref; | ||
175 | 11 | 30µs | 11 | 8µs | my $handler = $pkg->can("_ATTR_${type}_${attr}"); # spent 8µs making 11 calls to UNIVERSAL::can, avg 764ns/call |
176 | 11 | 2µs | next unless $handler; | ||
177 | my $decl = [$pkg, $ref, $attr, $data, | ||||
178 | 11 | 22µs | $raw{$handler}, $phase{$handler}, $filename, $linenum]; | ||
179 | 11 | 4µs | foreach my $gphase (@global_phases) { | ||
180 | _apply_handler_AH_($decl,$gphase) | ||||
181 | 44 | 23µs | 11 | 21µs | if $global_phases{$gphase} <= $global_phase; # spent 21µs making 11 calls to Attribute::Handlers::_apply_handler_AH_, avg 2µs/call |
182 | } | ||||
183 | 11 | 6µs | if ($global_phase != 0) { | ||
184 | # if _gen_handler_AH_ is being called after | ||||
185 | # CHECK it's for a lexical, so make sure | ||||
186 | # it didn't want to run anything later | ||||
187 | |||||
188 | local $Carp::CarpLevel = 2; | ||||
189 | carp "Won't be able to apply END handler" | ||||
190 | if $phase{$handler}{END}; | ||||
191 | } | ||||
192 | else { | ||||
193 | 11 | 4µs | push @declarations, $decl | ||
194 | } | ||||
195 | } | ||||
196 | 12 | 6µs | $_ = undef; | ||
197 | } | ||||
198 | 25 | 43µs | return grep {defined && !/$builtin/} @attrs; | ||
199 | } | ||||
200 | 4 | 12µs | } | ||
201 | |||||
202 | { | ||||
203 | 3 | 93µs | 2 | 20µs | # spent 13µs (5+7) within Attribute::Handlers::BEGIN@203 which was called:
# once (5µs+7µs) by App::Rad::Help::BEGIN@2 at line 203 # spent 13µs making 1 call to Attribute::Handlers::BEGIN@203
# spent 7µs making 1 call to strict::unimport |
204 | *{"Attribute::Handlers::UNIVERSAL::MODIFY_${_}_ATTRIBUTES"} = | ||||
205 | 1 | 11µs | 4 | 9µs | _gen_handler_AH_ foreach @{$validtype{ANY}}; # spent 9µs making 4 calls to Attribute::Handlers::_gen_handler_AH_, avg 2µs/call |
206 | } | ||||
207 | 1 | 6µs | push @UNIVERSAL::ISA, 'Attribute::Handlers::UNIVERSAL' | ||
208 | unless grep /^Attribute::Handlers::UNIVERSAL$/, @UNIVERSAL::ISA; | ||||
209 | |||||
210 | # spent 3.12ms (1.54+1.58) within Attribute::Handlers::_apply_handler_AH_ which was called 44 times, avg 71µs/call:
# 11 times (1.46ms+1.58ms) by Attribute::Handlers::CHECK at line 245, avg 276µs/call
# 11 times (34µs+0s) by Attribute::Handlers::END at line 260, avg 3µs/call
# 11 times (32µs+0s) by Attribute::Handlers::INIT at line 252, avg 3µs/call
# 11 times (21µs+0s) by Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] at line 181, avg 2µs/call | ||||
211 | 44 | 25µs | my ($declaration, $phase) = @_; | ||
212 | 44 | 43µs | my ($pkg, $ref, $attr, $data, $raw, $handlerphase, $filename, $linenum) = @$declaration; | ||
213 | 44 | 68µs | return unless $handlerphase->{$phase}; | ||
214 | # print STDERR "Handling $attr on $ref in $phase with [$data]\n"; | ||||
215 | 11 | 5µs | my $type = ref $ref; | ||
216 | 11 | 8µs | my $handler = "_ATTR_${type}_${attr}"; | ||
217 | 11 | 57µs | 11 | 1.19ms | my $sym = findsym($pkg, $ref); # spent 1.19ms making 11 calls to Attribute::Handlers::findsym, avg 108µs/call |
218 | 11 | 3µs | $sym ||= $type eq 'CODE' ? 'ANON' : 'LEXICAL'; | ||
219 | 2 | 83µs | 2 | 32µs | # spent 19µs (6+13) within Attribute::Handlers::BEGIN@219 which was called:
# once (6µs+13µs) by App::Rad::Help::BEGIN@2 at line 219 # spent 19µs making 1 call to Attribute::Handlers::BEGIN@219
# spent 13µs making 1 call to warnings::unimport |
220 | 11 | 6µs | if (!$raw && defined($data)) { | ||
221 | 11 | 5µs | if ($data ne '') { | ||
222 | 11 | 384µs | my $evaled = eval("package $pkg; no warnings; no strict; # spent 116µs executing statements in string eval # includes 18µs spent executing 2 calls to 3 subs defined therein. # spent 111µs executing statements in string eval # includes 17µs spent executing 2 calls to 3 subs defined therein. # spent 101µs executing statements in string eval # includes 19µs spent executing 2 calls to 3 subs defined therein. # spent 93µs executing statements in string eval # includes 18µs spent executing 2 calls to 3 subs defined therein. # spent 89µs executing statements in string eval # includes 19µs spent executing 2 calls to 3 subs defined therein. # spent 86µs executing statements in string eval # includes 16µs spent executing 2 calls to 3 subs defined therein. # spent 86µs executing statements in string eval # includes 18µs spent executing 2 calls to 3 subs defined therein. # spent 84µs executing statements in string eval # includes 16µs spent executing 2 calls to 3 subs defined therein. # spent 82µs executing statements in string eval # includes 21µs spent executing 2 calls to 3 subs defined therein. # spent 80µs executing statements in string eval # includes 19µs spent executing 2 calls to 3 subs defined therein. # spent 78µs executing statements in string eval # includes 17µs spent executing 2 calls to 3 subs defined therein. | ||
223 | local \$SIG{__WARN__}=sub{die}; [$data]"); | ||||
224 | 11 | 5µs | $data = $evaled unless $@; | ||
225 | } | ||||
226 | else { $data = undef } | ||||
227 | } | ||||
228 | $pkg->$handler($sym, | ||||
229 | 11 | 35µs | 11 | 48µs | (ref $sym eq 'GLOB' ? *{$sym}{ref $ref}||$ref : $ref), # spent 48µs making 11 calls to UNIVERSAL::Help, avg 4µs/call |
230 | $attr, | ||||
231 | $data, | ||||
232 | $phase, | ||||
233 | $filename, | ||||
234 | $linenum, | ||||
235 | ); | ||||
236 | 11 | 29µs | return 1; | ||
237 | } | ||||
238 | |||||
239 | { | ||||
240 | 2 | 105µs | 2 | 18µs | # spent 12µs (5+6) within Attribute::Handlers::BEGIN@240 which was called:
# once (5µs+6µs) by App::Rad::Help::BEGIN@2 at line 240 # spent 12µs making 1 call to Attribute::Handlers::BEGIN@240
# spent 6µs making 1 call to warnings::unimport |
241 | # spent 3.07ms (39µs+3.04) within Attribute::Handlers::CHECK which was called:
# once (39µs+3.04ms) by main::RUNTIME at line 0 of /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage | ||||
242 | 1 | 200ns | $global_phase++; | ||
243 | 1 | 2µs | 1 | 2µs | _resolve_lastattr if _delayed_name_resolution; # spent 2µs making 1 call to Attribute::Handlers::__ANON__[Attribute/Handlers.pm:115] |
244 | 1 | 6µs | foreach my $decl (@declarations) { | ||
245 | 11 | 15µs | 11 | 3.03ms | _apply_handler_AH_($decl, 'CHECK'); # spent 3.03ms making 11 calls to Attribute::Handlers::_apply_handler_AH_, avg 276µs/call |
246 | } | ||||
247 | } | ||||
248 | |||||
249 | # spent 57µs (25+32) within Attribute::Handlers::INIT which was called:
# once (25µs+32µs) by main::RUNTIME at line 0 of /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage | ||||
250 | 1 | 700ns | $global_phase++; | ||
251 | 1 | 5µs | foreach my $decl (@declarations) { | ||
252 | 11 | 11µs | 11 | 32µs | _apply_handler_AH_($decl, 'INIT'); # spent 32µs making 11 calls to Attribute::Handlers::_apply_handler_AH_, avg 3µs/call |
253 | } | ||||
254 | } | ||||
255 | } | ||||
256 | |||||
257 | 1 | 200ns | # spent 61µs (27+34) within Attribute::Handlers::END which was called:
# once (27µs+34µs) by main::RUNTIME at line 0 of /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage | ||
258 | 1 | 500ns | $global_phase++; | ||
259 | 1 | 4µs | foreach my $decl (@declarations) { | ||
260 | 11 | 16µs | 11 | 34µs | _apply_handler_AH_($decl, 'END'); # spent 34µs making 11 calls to Attribute::Handlers::_apply_handler_AH_, avg 3µs/call |
261 | } | ||||
262 | } | ||||
263 | |||||
264 | 1 | 11µs | 1; | ||
265 | __END__ | ||||
# spent 29µs within Attribute::Handlers::CORE:match which was called 12 times, avg 2µs/call:
# 12 times (29µs+0s) by Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] at line 150, avg 2µs/call | |||||
sub Attribute::Handlers::CORE:qr; # opcode | |||||
# spent 900ns within Attribute::Handlers::CORE:subst which was called 5 times, avg 180ns/call:
# once (500ns+0s) by Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] at line 154
# once (200ns+0s) by Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] at line 157
# once (100ns+0s) by Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] at line 159
# once (100ns+0s) by Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] at line 155
# once (0s+0s) by Attribute::Handlers::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/Attribute/Handlers.pm:199] at line 163 |