← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:15 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/namespace/autoclean.pm
StatementsExecuted 57 statements in 771µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.21ms1.57msnamespace::autoclean::::BEGIN@16namespace::autoclean::BEGIN@16
111289µs2.27msnamespace::autoclean::::BEGIN@14namespace::autoclean::BEGIN@14
11196µs1.57msnamespace::autoclean::::__ANON__[:57]namespace::autoclean::__ANON__[:57]
11113µs23µsnamespace::autoclean::::importnamespace::autoclean::import
11110µs21µsAtom::::BEGIN@1 Atom::BEGIN@1
11110µs22µsnamespace::autoclean::::BEGIN@13namespace::autoclean::BEGIN@13
1117µs10µsAtom::::BEGIN@2.2 Atom::BEGIN@2.2
1117µs26µsnamespace::autoclean::::BEGIN@15namespace::autoclean::BEGIN@15
1113µs3µsnamespace::autoclean::::BEGIN@5namespace::autoclean::BEGIN@5
0000s0snamespace::autoclean::::__ANON__[:25]namespace::autoclean::__ANON__[:25]
0000s0snamespace::autoclean::::__ANON__[:26]namespace::autoclean::__ANON__[:26]
0000s0snamespace::autoclean::::__ANON__[:27]namespace::autoclean::__ANON__[:27]
0000s0snamespace::autoclean::::__ANON__[:33]namespace::autoclean::__ANON__[:33]
0000s0snamespace::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
1223µs231µs
# spent 21µs (10+11) within Atom::BEGIN@1 which was called: # once (10µs+11µs) by Atom::BEGIN@3 at line 1
use strict;
# spent 21µs making 1 call to Atom::BEGIN@1 # spent 11µs making 1 call to strict::import
2239µs214µs
# spent 10µs (7+3) within Atom::BEGIN@2.2 which was called: # once (7µs+3µs) by Atom::BEGIN@3 at line 2
use warnings;
# spent 10µs making 1 call to Atom::BEGIN@2.2 # spent 3µs making 1 call to warnings::import
3
4package namespace::autoclean;
5
# spent 3µs within namespace::autoclean::BEGIN@5 which was called: # once (3µs+0s) by Atom::BEGIN@3 at line 7
BEGIN {
613µs $namespace::autoclean::AUTHORITY = 'cpan:FLORA';
7129µs13µs}
# spent 3µs making 1 call to namespace::autoclean::BEGIN@5
8{
92500ns $namespace::autoclean::VERSION = '0.13';
10}
11# ABSTRACT: Keep imports out of your namespace
12
13338µs234µs
# spent 22µs (10+12) within namespace::autoclean::BEGIN@13 which was called: # once (10µs+12µs) by Atom::BEGIN@3 at line 13
use Class::MOP 0.80;
# spent 22µs making 1 call to namespace::autoclean::BEGIN@13 # spent 12µs making 1 call to UNIVERSAL::VERSION
14299µs22.29ms
# spent 2.27ms (289µs+1.98) within namespace::autoclean::BEGIN@14 which was called: # once (289µs+1.98ms) by Atom::BEGIN@3 at line 14
use B::Hooks::EndOfScope;
# spent 2.27ms making 1 call to namespace::autoclean::BEGIN@14 # spent 14µs making 1 call to Sub::Exporter::Progressive::__ANON__[Sub/Exporter/Progressive.pm:40]
15224µs245µs
# spent 26µs (7+19) within namespace::autoclean::BEGIN@15 which was called: # once (7µs+19µs) by Atom::BEGIN@3 at line 15
use List::Util qw( first );
# spent 26µs making 1 call to namespace::autoclean::BEGIN@15 # spent 19µs making 1 call to Exporter::import
163401µs31.72ms
# spent 1.57ms (1.21+352µs) within namespace::autoclean::BEGIN@16 which was called: # once (1.21ms+352µs) by Atom::BEGIN@3 at line 16
use namespace::clean 0.20;
# spent 1.57ms making 1 call to namespace::autoclean::BEGIN@16 # spent 149µs making 1 call to namespace::clean::import # spent 8µs making 1 call to UNIVERSAL::VERSION
17
18
19
# spent 23µs (13+10) within namespace::autoclean::import which was called: # once (13µs+10µs) by Atom::BEGIN@3 at line 3 of lib/HackaMol/Atom.pm
sub import {
201600ns 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 };
2712µs };
28
29 my $runtest = sub {
30 my ($code, $method_name) = @_;
31 local $_ = $method_name;
32 return $code->();
3311µs };
34
3511µs my $cleanee = exists $args{-cleanee} ? $args{-cleanee} : scalar caller;
36
37 my @also = map { $subcast->($_) } (
38 exists $args{-also}
391500ns ? (ref $args{-also} eq 'ARRAY' ? @{ $args{-also} } : $args{-also})
40 : ()
41 );
42
43
# spent 1.57ms (96µs+1.47) within namespace::autoclean::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/namespace/autoclean.pm:57] which was called: # once (96µs+1.47ms) by B::Hooks::EndOfScope::XS::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/B/Hooks/EndOfScope/XS.pm:26] at line 26 of B/Hooks/EndOfScope/XS.pm
on_scope_end {
4412µs16µs my $meta = Class::MOP::Class->initialize($cleanee);
# spent 6µs making 1 call to Class::MOP::Class::initialize
45111µs11.01ms my %methods = map { ($_ => 1) } $meta->get_method_list;
# spent 1.01ms making 1 call to Class::MOP::Mixin::HasMethods::get_method_list
4614µs11µs $methods{meta} = 1 if $meta->isa('Moose::Meta::Role') && Moose->VERSION < 0.90;
# spent 1µs making 1 call to UNIVERSAL::isa
471300ns my %extra = ();
48
4914µs for my $method (keys %methods) {
50133µs next if exists $extra{$_};
511349µs134µs next unless first { $runtest->($_, $method) } @also;
# spent 4µs making 13 calls to List::Util::first, avg 323ns/call
52 $extra{ $method } = 1;
53 }
54
5519µs118µs my @symbols = keys %{ $meta->get_all_package_symbols('CODE') };
# spent 18µs making 1 call to Class::MOP::Package::get_all_package_symbols
5618µs1432µs namespace::clean->clean_subroutines($cleanee, keys %extra, grep { !$methods{$_} } @symbols);
# spent 432µs making 1 call to namespace::clean::clean_subroutines
5717µs110µs };
# spent 10µs making 1 call to B::Hooks::EndOfScope::XS::on_scope_end
58}
59
6012µs1;
61
6218µs1106µs__END__