← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:45:08 2010
Reported on Wed Nov 17 22:10:45 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Package/Stash.pm
StatementsExecuted 236452 statements in 2.11s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1126963573ms884msPackage::Stash::::get_package_symbolPackage::Stash::get_package_symbol
674043536ms726msPackage::Stash::::add_package_symbolPackage::Stash::add_package_symbol
526073267ms389msPackage::Stash::::has_package_symbolPackage::Stash::has_package_symbol
1765453154ms154msPackage::Stash::::namespacePackage::Stash::namespace
82511127ms469msPackage::Stash::::remove_package_symbolPackage::Stash::remove_package_symbol
374611103ms124msPackage::Stash::::_valid_for_typePackage::Stash::_valid_for_type
45584191.1ms91.1msPackage::Stash::::_deconstruct_variable_namePackage::Stash::_deconstruct_variable_name
83903281.1ms81.1msPackage::Stash::::namePackage::Stash::name
8251132.5ms39.6msPackage::Stash::::remove_package_globPackage::Stash::remove_package_glob
8861120.8ms82.3msPackage::Stash::::get_or_add_package_symbolPackage::Stash::get_or_add_package_symbol
4296220.3ms20.3msPackage::Stash::::newPackage::Stash::new
511602µs650µsPackage::Stash::::list_all_package_symbolsPackage::Stash::list_all_package_symbols
11145µs45µsPackage::Stash::::BEGIN@2Package::Stash::BEGIN@2
11142µs106µsPackage::Stash::::BEGIN@18Package::Stash::BEGIN@18
11141µs124µsPackage::Stash::::BEGIN@108Package::Stash::BEGIN@108
11140µs108µsPackage::Stash::::BEGIN@107Package::Stash::BEGIN@107
11140µs104µsPackage::Stash::::BEGIN@185Package::Stash::BEGIN@185
11138µs113µsPackage::Stash::::BEGIN@6Package::Stash::BEGIN@6
11137µs100µsPackage::Stash::::BEGIN@115Package::Stash::BEGIN@115
11137µs168µsPackage::Stash::::BEGIN@10Package::Stash::BEGIN@10
11137µs54µsPackage::Stash::::BEGIN@5Package::Stash::BEGIN@5
11135µs183µsPackage::Stash::::BEGIN@9Package::Stash::BEGIN@9
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Package::Stash;
2
# spent 45µs within Package::Stash::BEGIN@2 which was called: # once (45µs+0s) by Class::MOP::Package::BEGIN@9 at line 4
BEGIN {
3126µs $Package::Stash::VERSION = '0.13';
4167µs145µs}
# spent 45µs making 1 call to Package::Stash::BEGIN@2
53104µs270µs
# spent 54µs (37+17) within Package::Stash::BEGIN@5 which was called: # once (37µs+17µs) by Class::MOP::Package::BEGIN@9 at line 5
use strict;
# spent 54µs making 1 call to Package::Stash::BEGIN@5 # spent 17µs making 1 call to strict::import
63117µs2188µs
# spent 113µs (38+75) within Package::Stash::BEGIN@6 which was called: # once (38µs+75µs) by Class::MOP::Package::BEGIN@9 at line 6
use warnings;
# spent 113µs making 1 call to Package::Stash::BEGIN@6 # spent 75µs making 1 call to warnings::import
7# ABSTRACT: routines for manipulating stashes
8
93120µs2331µs
# spent 183µs (35+148) within Package::Stash::BEGIN@9 which was called: # once (35µs+148µs) by Class::MOP::Package::BEGIN@9 at line 9
use Carp qw(confess);
# spent 183µs making 1 call to Package::Stash::BEGIN@9 # spent 148µs making 1 call to Exporter::import
103206µs2299µs
# spent 168µs (37+131) within Package::Stash::BEGIN@10 which was called: # once (37µs+131µs) by Class::MOP::Package::BEGIN@9 at line 10
use Scalar::Util qw(reftype);
# spent 168µs making 1 call to Package::Stash::BEGIN@10 # spent 131µs making 1 call to Exporter::import
11
12
13
# spent 20.3ms within Package::Stash::new which was called 429 times, avg 47µs/call: # 306 times (14.9ms+0s) by Class::MOP::Package::_package_stash at line 94 of Class/MOP/Package.pm, avg 49µs/call # 54 times (2.51ms+0s) by namespace::clean::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/clean.pm:52] at line 27 of namespace/clean.pm, avg 46µs/call # 54 times (2.35ms+0s) by namespace::clean::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/clean.pm:52] at line 26 of namespace/clean.pm, avg 44µs/call # 5 times (220µs+0s) by namespace::clean::get_functions at line 151 of namespace/clean.pm, avg 44µs/call # 5 times (171µs+0s) by namespace::clean::get_class_store at line 140 of namespace/clean.pm, avg 34µs/call # 5 times (161µs+0s) by namespace::clean::import at line 90 of namespace/clean.pm, avg 32µs/call
sub new {
14214515.8ms my $class = shift;
15 my ($package) = @_;
16 my $namespace;
17 {
1831.46ms2170µs
# spent 106µs (42+64) within Package::Stash::BEGIN@18 which was called: # once (42µs+64µs) by Class::MOP::Package::BEGIN@9 at line 18
no strict 'refs';
# spent 106µs making 1 call to Package::Stash::BEGIN@18 # spent 64µs making 1 call to strict::unimport
19 # supposedly this caused a bug in earlier perls, but I can't reproduce
20 # it, so re-enabling the caching
214296.57ms $namespace = \%{$package . '::'};
22 }
23 return bless {
24 'package' => $package,
25 'namespace' => $namespace,
26 }, $class;
27}
28
29
30
# spent 81.1ms within Package::Stash::name which was called 8390 times, avg 10µs/call: # 6740 times (65.7ms+0s) by Package::Stash::add_package_symbol at line 86, avg 10µs/call # 825 times (8.28ms+0s) by namespace::clean::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/clean.pm:52] at line 43 of namespace/clean.pm, avg 10µs/call # 825 times (7.11ms+0s) by Package::Stash::remove_package_glob at line 116, avg 9µs/call
sub name {
318390117ms return $_[0]->{package};
32}
33
34
35
# spent 154ms within Package::Stash::namespace which was called 17654 times, avg 9µs/call: # 11269 times (97.8ms+0s) by Package::Stash::get_package_symbol at line 157, avg 9µs/call # 5260 times (45.2ms+0s) by Package::Stash::has_package_symbol at line 129, avg 9µs/call # 825 times (7.31ms+0s) by namespace::clean::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/clean.pm:52] at line 36 of namespace/clean.pm, avg 9µs/call # 295 times (3.26ms+0s) by Class::MOP::Package::namespace at line 97 of Class/MOP/Package.pm, avg 11µs/call # 5 times (48µs+0s) by Package::Stash::list_all_package_symbols at line 268, avg 10µs/call
sub namespace {
3617654232ms return $_[0]->{namespace};
37}
38
39{
40219µs my %SIGIL_MAP = (
41 '$' => 'SCALAR',
42 '@' => 'ARRAY',
43 '%' => 'HASH',
44 '&' => 'CODE',
45 '' => 'IO',
46 );
47
48
# spent 91.1ms within Package::Stash::_deconstruct_variable_name which was called 4558 times, avg 20µs/call: # 2785 times (57.5ms+0s) by Package::Stash::has_package_symbol at line 126, avg 21µs/call # 927 times (17.6ms+0s) by Package::Stash::get_package_symbol at line 154, avg 19µs/call # 825 times (15.6ms+0s) by Package::Stash::remove_package_symbol at line 205, avg 19µs/call # 21 times (394µs+0s) by Package::Stash::add_package_symbol at line 83, avg 19µs/call
sub _deconstruct_variable_name {
4918232111ms my ($self, $variable) = @_;
50
51 (defined $variable && length $variable)
52 || confess "You must pass a variable name";
53
54 my $sigil = substr($variable, 0, 1, '');
55
56 if (exists $SIGIL_MAP{$sigil}) {
57 return ($variable, $sigil, $SIGIL_MAP{$sigil});
58 }
59 else {
60 return ("${sigil}${variable}", '', $SIGIL_MAP{''});
61 }
62 }
63}
64
65
66
# spent 124ms (103+20.9) within Package::Stash::_valid_for_type which was called 3746 times, avg 33µs/call: # 3746 times (103ms+20.9ms) by Package::Stash::add_package_symbol at line 89, avg 33µs/call
sub _valid_for_type {
6711238106ms my $self = shift;
68 my ($value, $type) = @_;
69165024.1ms292116.7ms if ($type eq 'HASH' || $type eq 'ARRAY'
# spent 16.7ms making 2921 calls to Scalar::Util::reftype, avg 6µs/call
70 || $type eq 'IO' || $type eq 'CODE') {
71 return reftype($value) eq $type;
72 }
73 else {
748254.21ms my $ref = reftype($value);
# spent 4.21ms making 825 calls to Scalar::Util::reftype, avg 5µs/call
75 return !defined($ref) || $ref eq 'SCALAR' || $ref eq 'REF' || $ref eq 'LVALUE';
76 }
77}
78
79
# spent 726ms (536+190) within Package::Stash::add_package_symbol which was called 6740 times, avg 108µs/call: # 2994 times (167ms+28.6ms) by Package::Stash::get_package_symbol at line 174, avg 65µs/call # 2916 times (312ms+125ms) by Class::MOP::Package::add_package_symbol at line 106 of Class/MOP/Package.pm, avg 150µs/call # 825 times (56.5ms+36.5ms) by Package::Stash::remove_package_symbol at line 257, avg 113µs/call # 5 times (441µs+318µs) by namespace::clean::get_class_store at line 142 of namespace/clean.pm, avg 152µs/call
sub add_package_symbol {
8033700363ms my ($self, $variable, $initial_value, %opts) = @_;
81
82 my ($name, $sigil, $type) = ref $variable eq 'HASH'
8321394µs ? @{$variable}{qw[name sigil type]}
# spent 394µs making 21 calls to Package::Stash::_deconstruct_variable_name, avg 19µs/call
84 : $self->_deconstruct_variable_name($variable);
85
86674065.7ms my $pkg = $self->name;
# spent 65.7ms making 6740 calls to Package::Stash::name, avg 10µs/call
87
88749270.4ms if (@_ > 2) {
893746124ms $self->_valid_for_type($initial_value, $type)
# spent 124ms making 3746 calls to Package::Stash::_valid_for_type, avg 33µs/call
90 || confess "$initial_value is not of type $type";
91
92 # cheap fail-fast check for PERLDBf_SUBLINE and '&'
931458089.7ms if ($^P and $^P & 0x10 && $sigil eq '&') {
94 my $filename = $opts{filename};
95 my $first_line_num = $opts{first_line_num};
96
97 (undef, $filename, $first_line_num) = caller
98 if not defined $filename;
99
100 my $last_line_num = $opts{last_line_num} || ($first_line_num ||= 0);
101
102 # http://perldoc.perl.org/perldebguts.html#Debugger-Internals
103 $DB::sub{$pkg . '::' . $name} = "$filename:$first_line_num-$last_line_num";
104 }
105 }
106
1073132µs2177µs
# spent 108µs (40+68) within Package::Stash::BEGIN@107 which was called: # once (40µs+68µs) by Class::MOP::Package::BEGIN@9 at line 107
no strict 'refs';
# spent 108µs making 1 call to Package::Stash::BEGIN@107 # spent 68µs making 1 call to strict::unimport
1083361µs2207µs
# spent 124µs (41+83) within Package::Stash::BEGIN@108 which was called: # once (41µs+83µs) by Class::MOP::Package::BEGIN@9 at line 108
no warnings 'redefine', 'misc', 'prototype';
# spent 124µs making 1 call to Package::Stash::BEGIN@108 # spent 83µs making 1 call to warnings::unimport
109 *{$pkg . '::' . $name} = ref $initial_value ? $initial_value : \$initial_value;
110}
111
112
113
# spent 39.6ms (32.5+7.11) within Package::Stash::remove_package_glob which was called 825 times, avg 48µs/call: # 825 times (32.5ms+7.11ms) by Package::Stash::remove_package_symbol at line 255, avg 48µs/call
sub remove_package_glob {
114165031.7ms my ($self, $name) = @_;
11531.02ms2163µs
# spent 100µs (37+63) within Package::Stash::BEGIN@115 which was called: # once (37µs+63µs) by Class::MOP::Package::BEGIN@9 at line 115
no strict 'refs';
# spent 100µs making 1 call to Package::Stash::BEGIN@115 # spent 63µs making 1 call to strict::unimport
1168257.11ms delete ${$self->name . '::'}{$name};
# spent 7.11ms making 825 calls to Package::Stash::name, avg 9µs/call
117}
118
119# ... these functions deal with stuff on the namespace level
120
121
122
# spent 389ms (267+122) within Package::Stash::has_package_symbol which was called 5260 times, avg 74µs/call: # 1863 times (88.9ms+55.9ms) by Class::MOP::Package::has_package_symbol at line 118 of Class/MOP/Package.pm, avg 78µs/call # 825 times (52.2ms+30.0ms) by namespace::clean::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/clean.pm:52] at line 34 of namespace/clean.pm, avg 100µs/call # 825 times (41.7ms+11.1ms) by Package::Stash::remove_package_symbol at line 241, avg 64µs/call # 825 times (39.3ms+11.0ms) by Package::Stash::remove_package_symbol at line 243, avg 61µs/call # 825 times (39.1ms+11.1ms) by Package::Stash::remove_package_symbol at line 242, avg 61µs/call # 92 times (5.34ms+3.02ms) by namespace::clean::import at line 102 of namespace/clean.pm, avg 91µs/call # 5 times (243µs+146µs) by namespace::clean::get_class_store at line 142 of namespace/clean.pm, avg 78µs/call
sub has_package_symbol {
12328008215ms my ($self, $variable) = @_;
124
125 my ($name, $sigil, $type) = ref $variable eq 'HASH'
126278557.5ms ? @{$variable}{qw[name sigil type]}
# spent 57.5ms making 2785 calls to Package::Stash::_deconstruct_variable_name, avg 21µs/call
127 : $self->_deconstruct_variable_name($variable);
128
129526045.2ms my $namespace = $self->namespace;
# spent 45.2ms making 5260 calls to Package::Stash::namespace, avg 9µs/call
130
131 return unless exists $namespace->{$name};
132
133 my $entry_ref = \$namespace->{$name};
134348447.7ms348419.6ms if (reftype($entry_ref) eq 'GLOB') {
# spent 19.6ms making 3484 calls to Scalar::Util::reftype, avg 6µs/call
135 if ( $type eq 'SCALAR' ) {
136 return defined ${ *{$entry_ref}{SCALAR} };
137 }
138 else {
139 return defined *{$entry_ref}{$type};
140 }
141 }
142 else {
143 # a symbol table entry can be -1 (stub), string (stub with prototype),
144 # or reference (constant)
145 return $type eq 'CODE';
146 }
147}
148
149
150
# spent 884ms (573+311) within Package::Stash::get_package_symbol which was called 11269 times, avg 78µs/call: # 8634 times (445ms+263ms) by Class::MOP::Package::get_package_symbol at line 123 of Class/MOP/Package.pm, avg 82µs/call # 886 times (45.8ms+15.7ms) by Package::Stash::get_or_add_package_symbol at line 197, avg 69µs/call # 825 times (42.9ms+22.8ms) by namespace::clean::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/clean.pm:52] at line 42 of namespace/clean.pm, avg 80µs/call # 825 times (34.0ms+6.76ms) by Package::Stash::remove_package_symbol at line 240, avg 49µs/call # 94 times (4.70ms+2.51ms) by namespace::clean::get_functions at line 153 of namespace/clean.pm, avg 77µs/call # 5 times (256µs+138µs) by namespace::clean::get_class_store at line 144 of namespace/clean.pm, avg 79µs/call
sub get_package_symbol {
15167614494ms my ($self, $variable, %opts) = @_;
152
153 my ($name, $sigil, $type) = ref $variable eq 'HASH'
15492717.6ms ? @{$variable}{qw[name sigil type]}
# spent 17.6ms making 927 calls to Package::Stash::_deconstruct_variable_name, avg 19µs/call
155 : $self->_deconstruct_variable_name($variable);
156
1571126997.8ms my $namespace = $self->namespace;
# spent 97.8ms making 11269 calls to Package::Stash::namespace, avg 9µs/call
158
159299417.1ms if (!exists $namespace->{$name}) {
160 # assigning to the result of this function like
161 # @{$stash->get_package_symbol('@ISA')} = @new_ISA
162 # makes the result not visible until the variable is explicitly
163 # accessed... in the case of @ISA, this might never happen
164 # for instance, assigning like that and then calling $obj->isa
165 # will fail. see t/005-isa.t
166299433.7ms if ($opts{vivify} && $type eq 'ARRAY' && $name ne 'ISA') {
167 $self->add_package_symbol($variable, []);
168 }
169 elsif ($opts{vivify} && $type eq 'HASH') {
170 $self->add_package_symbol($variable, {});
171 }
172 else {
173 # FIXME
1742994196ms $self->add_package_symbol($variable)
# spent 196ms making 2994 calls to Package::Stash::add_package_symbol, avg 65µs/call
175 }
176 }
177
178 my $entry_ref = \$namespace->{$name};
179
180 if (ref($entry_ref) eq 'GLOB') {
181 return *{$entry_ref}{$type};
182 }
183 else {
184 if ($type eq 'CODE') {
18532.13ms2169µs
# spent 104µs (40+65) within Package::Stash::BEGIN@185 which was called: # once (40µs+65µs) by Class::MOP::Package::BEGIN@9 at line 185
no strict 'refs';
# spent 104µs making 1 call to Package::Stash::BEGIN@185 # spent 65µs making 1 call to strict::unimport
186 return \&{ $self->name . '::' . $name };
187 }
188 else {
189 return undef;
190 }
191 }
192}
193
194
195
# spent 82.3ms (20.8+61.5) within Package::Stash::get_or_add_package_symbol which was called 886 times, avg 93µs/call: # 886 times (20.8ms+61.5ms) by Class::MOP::Package::get_or_add_package_symbol at line 128 of Class/MOP/Package.pm, avg 93µs/call
sub get_or_add_package_symbol {
196177219.3ms my $self = shift;
19788661.5ms $self->get_package_symbol(@_, vivify => 1);
# spent 61.5ms making 886 calls to Package::Stash::get_package_symbol, avg 69µs/call
198}
199
200
201
# spent 469ms (127+342) within Package::Stash::remove_package_symbol which was called 825 times, avg 569µs/call: # 825 times (127ms+342ms) by namespace::clean::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/clean.pm:52] at line 50 of namespace/clean.pm, avg 569µs/call
sub remove_package_symbol {
202907577.8ms my ($self, $variable) = @_;
203
204 my ($name, $sigil, $type) = ref $variable eq 'HASH'
20582515.6ms ? @{$variable}{qw[name sigil type]}
# spent 15.6ms making 825 calls to Package::Stash::_deconstruct_variable_name, avg 19µs/call
206 : $self->_deconstruct_variable_name($variable);
207
208 # FIXME:
209 # no doubt this is grossly inefficient and
210 # could be done much easier and faster in XS
211
212 my ($scalar_desc, $array_desc, $hash_desc, $code_desc, $io_desc) = (
213 { sigil => '$', type => 'SCALAR', name => $name },
214 { sigil => '@', type => 'ARRAY', name => $name },
215 { sigil => '%', type => 'HASH', name => $name },
216 { sigil => '&', type => 'CODE', name => $name },
217 { sigil => '', type => 'IO', name => $name },
218 );
219
220 my ($scalar, $array, $hash, $code, $io);
221330034.1ms if ($type eq 'SCALAR') {
222 $array = $self->get_package_symbol($array_desc) if $self->has_package_symbol($array_desc);
223 $hash = $self->get_package_symbol($hash_desc) if $self->has_package_symbol($hash_desc);
224 $code = $self->get_package_symbol($code_desc) if $self->has_package_symbol($code_desc);
225 $io = $self->get_package_symbol($io_desc) if $self->has_package_symbol($io_desc);
226 }
227 elsif ($type eq 'ARRAY') {
228 $scalar = $self->get_package_symbol($scalar_desc);
229 $hash = $self->get_package_symbol($hash_desc) if $self->has_package_symbol($hash_desc);
230 $code = $self->get_package_symbol($code_desc) if $self->has_package_symbol($code_desc);
231 $io = $self->get_package_symbol($io_desc) if $self->has_package_symbol($io_desc);
232 }
233 elsif ($type eq 'HASH') {
234 $scalar = $self->get_package_symbol($scalar_desc);
235 $array = $self->get_package_symbol($array_desc) if $self->has_package_symbol($array_desc);
236 $code = $self->get_package_symbol($code_desc) if $self->has_package_symbol($code_desc);
237 $io = $self->get_package_symbol($io_desc) if $self->has_package_symbol($io_desc);
238 }
239 elsif ($type eq 'CODE') {
24082540.8ms $scalar = $self->get_package_symbol($scalar_desc);
# spent 40.8ms making 825 calls to Package::Stash::get_package_symbol, avg 49µs/call
24182552.8ms $array = $self->get_package_symbol($array_desc) if $self->has_package_symbol($array_desc);
# spent 52.8ms making 825 calls to Package::Stash::has_package_symbol, avg 64µs/call
24282550.1ms $hash = $self->get_package_symbol($hash_desc) if $self->has_package_symbol($hash_desc);
# spent 50.1ms making 825 calls to Package::Stash::has_package_symbol, avg 61µs/call
24382550.3ms $io = $self->get_package_symbol($io_desc) if $self->has_package_symbol($io_desc);
# spent 50.3ms making 825 calls to Package::Stash::has_package_symbol, avg 61µs/call
244 }
245 elsif ($type eq 'IO') {
246 $scalar = $self->get_package_symbol($scalar_desc);
247 $array = $self->get_package_symbol($array_desc) if $self->has_package_symbol($array_desc);
248 $hash = $self->get_package_symbol($hash_desc) if $self->has_package_symbol($hash_desc);
249 $code = $self->get_package_symbol($code_desc) if $self->has_package_symbol($code_desc);
250 }
251 else {
252 confess "This should never ever ever happen";
253 }
254
25582539.6ms $self->remove_package_glob($name);
# spent 39.6ms making 825 calls to Package::Stash::remove_package_glob, avg 48µs/call
256
25782593.0ms $self->add_package_symbol($scalar_desc => $scalar);
# spent 93.0ms making 825 calls to Package::Stash::add_package_symbol, avg 113µs/call
258 $self->add_package_symbol($array_desc => $array) if defined $array;
259 $self->add_package_symbol($hash_desc => $hash) if defined $hash;
260 $self->add_package_symbol($code_desc => $code) if defined $code;
261 $self->add_package_symbol($io_desc => $io) if defined $io;
262}
263
264
265
# spent 650µs (602+48) within Package::Stash::list_all_package_symbols which was called 5 times, avg 130µs/call: # 5 times (602µs+48µs) by namespace::clean::get_functions at line 153 of namespace/clean.pm, avg 130µs/call
sub list_all_package_symbols {
26620613µs my ($self, $type_filter) = @_;
267
268548µs my $namespace = $self->namespace;
# spent 48µs making 5 calls to Package::Stash::namespace, avg 10µs/call
269 return keys %{$namespace} unless defined $type_filter;
270
271 # NOTE:
272 # or we can filter based on
273 # type (SCALAR|ARRAY|HASH|CODE)
274 if ($type_filter eq 'CODE') {
275 return grep {
276 (ref($namespace->{$_})
277 ? (ref($namespace->{$_}) eq 'SCALAR')
278 : (ref(\$namespace->{$_}) eq 'GLOB'
279 && defined(*{$namespace->{$_}}{CODE})));
280 } keys %{$namespace};
281 } else {
282 return grep { *{$namespace->{$_}}{$type_filter} } keys %{$namespace};
283 }
284}
285
286
287115µs1;
288
289__END__