Profile of namespace/autoclean.pm

← 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:43 2012

Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/namespace/autoclean.pm
Statements | Executed 43 statements in 1.07ms

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 1.27ms | 1.86ms | namespace::autoclean::::BEGIN@16namespace::autoclean::BEGIN@16
1 | 1 | 1 | 316µs | 2.10ms | namespace::autoclean::::BEGIN@14namespace::autoclean::BEGIN@14
1 | 1 | 1 | 242µs | 2.12ms | namespace::autoclean::::__ANON__[:57]namespace::autoclean::__ANON__[:57]
1 | 1 | 1 | 56µs | 107µs | namespace::autoclean::::importnamespace::autoclean::import
1 | 1 | 1 | 15µs | 36µs | namespace::autoclean::::BEGIN@13namespace::autoclean::BEGIN@13
1 | 1 | 1 | 13µs | 43µs | namespace::autoclean::::BEGIN@15namespace::autoclean::BEGIN@15
1 | 1 | 1 | 13µs | 16µs | MooseX::Traits::::BEGIN@1 MooseX::Traits::BEGIN@1
1 | 1 | 1 | 7µs | 14µs | MooseX::Traits::::BEGIN@2.6 MooseX::Traits::BEGIN@2.6
1 | 1 | 1 | 3µs | 3µs | namespace::autoclean::::BEGIN@5namespace::autoclean::BEGIN@5
0 | 0 | 0 | 0s | 0s | namespace::autoclean::::__ANON__[:25]namespace::autoclean::__ANON__[:25]
0 | 0 | 0 | 0s | 0s | namespace::autoclean::::__ANON__[:26]namespace::autoclean::__ANON__[:26]
0 | 0 | 0 | 0s | 0s | namespace::autoclean::::__ANON__[:27]namespace::autoclean::__ANON__[:27]
0 | 0 | 0 | 0s | 0s | namespace::autoclean::::__ANON__[:33]namespace::autoclean::__ANON__[:33]
0 | 0 | 0 | 0s | 0s | namespace::autoclean::::__ANON__[:51]namespace::autoclean::__ANON__[:51]

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 | 3 | 17µs | 2 | 19µs | # spent 16µs (13+3) within MooseX::Traits::BEGIN@1 which was called: # once (13µs+3µs) by MooseX::Traits::BEGIN@9 at line 1 use strict; # spent 16µs making 1 call to MooseX::Traits::BEGIN@1 # spent 3µs making 1 call to strict::import
2 | 3 | 34µs | 2 | 21µs | # spent 14µs (7+7) within MooseX::Traits::BEGIN@2.6 which was called: # once (7µs+7µs) by MooseX::Traits::BEGIN@9 at line 2 use warnings; # spent 14µs making 1 call to MooseX::Traits::BEGIN@2.6 # spent 7µs making 1 call to warnings::import
3 |  |  |  |  |
4 |  |  |  |  | package namespace::autoclean;
5 |  |  |  |  | # spent 3µs within namespace::autoclean::BEGIN@5 which was called: # once (3µs+0s) by MooseX::Traits::BEGIN@9 at line 7 BEGIN {
6 | 1 | 6µs |  |  | $namespace::autoclean::AUTHORITY = 'cpan:FLORA';
7 | 1 | 75µs | 1 | 3µs | } # spent 3µs making 1 call to namespace::autoclean::BEGIN@5
8 |  |  |  |  | {
9 | 2 | 3µs |  |  | $namespace::autoclean::VERSION = '0.13';
10 |  |  |  |  | }
11 |  |  |  |  | # ABSTRACT: Keep imports out of your namespace
12 |  |  |  |  |
13 | 3 | 48µs | 2 | 57µs | # spent 36µs (15+21) within namespace::autoclean::BEGIN@13 which was called: # once (15µs+21µs) by MooseX::Traits::BEGIN@9 at line 13 use Class::MOP 0.80; # spent 36µs making 1 call to namespace::autoclean::BEGIN@13 # spent 21µs making 1 call to UNIVERSAL::VERSION
14 | 3 | 84µs | 2 | 2.27ms | # spent 2.10ms (316µs+1.78) within namespace::autoclean::BEGIN@14 which was called: # once (316µs+1.78ms) by MooseX::Traits::BEGIN@9 at line 14 use B::Hooks::EndOfScope; # spent 2.10ms making 1 call to namespace::autoclean::BEGIN@14 # spent 175µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
15 | 3 | 27µs | 2 | 72µs | # spent 43µs (13+30) within namespace::autoclean::BEGIN@15 which was called: # once (13µs+30µs) by MooseX::Traits::BEGIN@9 at line 15 use List::Util qw( first ); # spent 43µs making 1 call to namespace::autoclean::BEGIN@15 # spent 30µs making 1 call to Exporter::import
16 | 3 | 424µs | 3 | 2.07ms | # spent 1.86ms (1.27+594µs) within namespace::autoclean::BEGIN@16 which was called: # once (1.27ms+594µs) by MooseX::Traits::BEGIN@9 at line 16 use namespace::clean 0.20; # spent 1.86ms making 1 call to namespace::autoclean::BEGIN@16 # spent 188µs making 1 call to namespace::clean::import # spent 20µs making 1 call to UNIVERSAL::VERSION
17 |  |  |  |  |
18 |  |  |  |  |
19 |  |  |  |  | # spent 107µs (56+52) within namespace::autoclean::import which was called: # once (56µs+52µs) by MooseX::Traits::BEGIN@9 at line 9 of MooseX/Traits.pm sub import {
20 | 1 | 4µs |  |  | my ($class, %args) = @_;
21 |  |  |  |  |
22 |  |  |  |  | my $subcast = sub {
23 |  |  |  |  | my $i = shift;
24 |  |  |  |  | return $i if ref $i eq 'CODE';
25 |  |  |  |  | return sub { $_ =~ $i } if ref $i eq 'Regexp';
26 |  |  |  |  | return sub { $_ eq $i };
27 | 1 | 9µs |  |  | };
28 |  |  |  |  |
29 |  |  |  |  | my $runtest = sub {
30 |  |  |  |  | my ($code, $method_name) = @_;
31 |  |  |  |  | local $_ = $method_name;
32 |  |  |  |  | return $code->();
33 | 1 | 6µs |  |  | };
34 |  |  |  |  |
35 | 1 | 6µs |  |  | my $cleanee = exists $args{-cleanee} ? $args{-cleanee} : scalar caller;
36 |  |  |  |  |
37 |  |  |  |  | my @also = map { $subcast->($_) } (
38 |  |  |  |  | exists $args{-also}
39 | 1 | 3µs |  |  | ? (ref $args{-also} eq 'ARRAY' ? @{ $args{-also} } : $args{-also})
40 |  |  |  |  | : ()
41 |  |  |  |  | );
42 |  |  |  |  |
43 |  |  |  |  | # spent 2.12ms (242µs+1.88) within namespace::autoclean::__ANON__[/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/namespace/autoclean.pm:57] which was called: # once (242µs+1.88ms) by B::Hooks::EndOfScope::__ANON__[/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/B/Hooks/EndOfScope.pm:26] at line 26 of B/Hooks/EndOfScope.pm on_scope_end {
44 | 1 | 10µs | 1 | 36µs | my $meta = Class::MOP::Class->initialize($cleanee); # spent 36µs making 1 call to Class::MOP::Class::initialize
45 | 1 | 51µs | 1 | 1.47ms | my %methods = map { ($_ => 1) } $meta->get_method_list; # spent 1.47ms making 1 call to Class::MOP::Mixin::HasMethods::get_method_list
46 | 1 | 58µs | 2 | 18µs | $methods{meta} = 1 if $meta->isa('Moose::Meta::Role') && Moose->VERSION < 0.90; # spent 14µs making 1 call to UNIVERSAL::VERSION # spent 4µs making 1 call to UNIVERSAL::isa
47 | 1 | 1µs |  |  | my %extra = ();
48 |  |  |  |  |
49 | 1 | 10µs |  |  | for my $method (keys %methods) {
50 | 4 | 5µs |  |  | next if exists $extra{$_};
51 | 4 | 63µs | 4 | 9µs | next unless first { $runtest->($_, $method) } @also; # spent 9µs making 4 calls to List::Util::first, avg 2µs/call
52 |  |  |  |  | $extra{ $method } = 1;
53 |  |  |  |  | }
54 |  |  |  |  |
55 | 1 | 26µs | 1 | 50µs | my @symbols = keys %{ $meta->get_all_package_symbols('CODE') }; # spent 50µs making 1 call to Class::MOP::Package::get_all_package_symbols
56 | 1 | 27µs | 1 | 296µs | namespace::clean->clean_subroutines($cleanee, keys %extra, grep { !$methods{$_} } @symbols); # spent 296µs making 1 call to namespace::clean::clean_subroutines
57 | 1 | 30µs | 1 | 52µs | }; # spent 52µs making 1 call to B::Hooks::EndOfScope::on_scope_end
58 |  |  |  |  | }
59 |  |  |  |  |
60 | 1 | 8µs |  |  | 1;
61 |  |  |  |  |
62 | 1 | 32µs | 1 | 38.4ms | __END__ # spent 38.4ms making 1 call to B::Hooks::EndOfScope::__ANON__[B/Hooks/EndOfScope.pm:26]