← 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:09 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/autoclean.pm
StatementsExecuted 996 statements in 26.3ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
491115.1ms943msnamespace::autoclean::::__ANON__[:57] namespace::autoclean::__ANON__[:57]
4949494.55ms9.21msnamespace::autoclean::::import namespace::autoclean::import
11178µs130µsMarkdent::Handler::HTMLStream::Document::::BEGIN@1Markdent::Handler::HTMLStream::Document::BEGIN@1
11174µs1.46msnamespace::autoclean::::BEGIN@16 namespace::autoclean::BEGIN@16
11147µs109µsnamespace::autoclean::::BEGIN@13 namespace::autoclean::BEGIN@13
11143µs221µsnamespace::autoclean::::BEGIN@15 namespace::autoclean::BEGIN@15
11142µs111µsMarkdent::Handler::HTMLStream::Document::::BEGIN@2.2Markdent::Handler::HTMLStream::Document::BEGIN@2.2
11138µs1.14msnamespace::autoclean::::BEGIN@14 namespace::autoclean::BEGIN@14
11118µs18µsnamespace::autoclean::::BEGIN@5 namespace::autoclean::BEGIN@5
11116µs16µsnamespace::autoclean::::BEGIN@8 namespace::autoclean::BEGIN@8
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
13145µs2181µs
# spent 130µs (78+51) within Markdent::Handler::HTMLStream::Document::BEGIN@1 which was called: # once (78µs+51µs) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 1
use strict;
# spent 130µs making 1 call to Markdent::Handler::HTMLStream::Document::BEGIN@1 # spent 51µs making 1 call to strict::import
23177µs2181µs
# spent 111µs (42+70) within Markdent::Handler::HTMLStream::Document::BEGIN@2.2 which was called: # once (42µs+70µs) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 2
use warnings;
# spent 111µs making 1 call to Markdent::Handler::HTMLStream::Document::BEGIN@2.2 # spent 70µs making 1 call to warnings::import
3
4package namespace::autoclean;
5
# spent 18µs within namespace::autoclean::BEGIN@5 which was called: # once (18µs+0s) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 7
BEGIN {
6121µs $namespace::autoclean::AUTHORITY = 'cpan:FLORA';
7182µs118µs}
# spent 18µs making 1 call to namespace::autoclean::BEGIN@5
8
# spent 16µs within namespace::autoclean::BEGIN@8 which was called: # once (16µs+0s) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 10
BEGIN {
9118µs $namespace::autoclean::VERSION = '0.11';
10180µs116µs}
# spent 16µs making 1 call to namespace::autoclean::BEGIN@8
11# ABSTRACT: Keep imports out of your namespace
12
133179µs2171µs
# spent 109µs (47+62) within namespace::autoclean::BEGIN@13 which was called: # once (47µs+62µs) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 13
use Class::MOP 0.80;
# spent 109µs making 1 call to namespace::autoclean::BEGIN@13 # spent 62µs making 1 call to UNIVERSAL::VERSION
143148µs22.23ms
# spent 1.14ms (38µs+1.10) within namespace::autoclean::BEGIN@14 which was called: # once (38µs+1.10ms) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 14
use B::Hooks::EndOfScope;
# spent 1.14ms making 1 call to namespace::autoclean::BEGIN@14 # spent 1.10ms making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
153123µs2398µs
# spent 221µs (43+178) within namespace::autoclean::BEGIN@15 which was called: # once (43µs+178µs) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 15
use List::Util qw( first );
# spent 221µs making 1 call to namespace::autoclean::BEGIN@15 # spent 178µs making 1 call to Exporter::import
1631.50ms32.84ms
# spent 1.46ms (74µs+1.38) within namespace::autoclean::BEGIN@16 which was called: # once (74µs+1.38ms) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 16
use namespace::clean 0.11;
# spent 1.46ms making 1 call to namespace::autoclean::BEGIN@16 # spent 1.32ms making 1 call to namespace::clean::import # spent 60µs making 1 call to UNIVERSAL::VERSION
17
18
19
# spent 9.21ms (4.55+4.65) within namespace::autoclean::import which was called 49 times, avg 188µs/call: # once (93µs+165µs) by Markdent::Parser::BEGIN@16 at line 16 of Markdent/Parser.pm # once (122µs+122µs) by Markdent::Event::HTMLEntity::BEGIN@11 at line 11 of Markdent/Event/HTMLEntity.pm # once (109µs+115µs) by Markdent::Event::StartParagraph::BEGIN@9 at line 9 of Markdent/Event/StartParagraph.pm # once (89µs+129µs) by Markdent::Event::StartStrong::BEGIN@11 at line 11 of Markdent/Event/StartStrong.pm # once (115µs+94µs) by Markdent::Event::EndCode::BEGIN@11 at line 11 of Markdent/Event/EndCode.pm # once (116µs+92µs) by Markdent::Event::StartOrderedList::BEGIN@9 at line 9 of Markdent/Event/StartOrderedList.pm # once (114µs+92µs) by Markdent::Event::EndOrderedList::BEGIN@9 at line 9 of Markdent/Event/EndOrderedList.pm # once (90µs+115µs) by Markdent::Role::EventAsText::BEGIN@9 at line 9 of Markdent/Role/EventAsText.pm # once (111µs+91µs) by Markdent::Event::EndUnorderedList::BEGIN@9 at line 9 of Markdent/Event/EndUnorderedList.pm # once (95µs+98µs) by Markdent::Event::Text::BEGIN@11 at line 11 of Markdent/Event/Text.pm # once (95µs+97µs) by Markdent::Simple::Document::BEGIN@14 at line 14 of Markdent/Simple/Document.pm # once (95µs+91µs) by Markdent::Role::Event::BEGIN@9 at line 9 of Markdent/Role/Event.pm # once (95µs+90µs) by Markdent::Event::EndLink::BEGIN@9 at line 9 of Markdent/Event/EndLink.pm # once (92µs+92µs) by Markdent::Event::EndEmphasis::BEGIN@11 at line 11 of Markdent/Event/EndEmphasis.pm # once (90µs+93µs) by Markdent::Event::Image::BEGIN@11 at line 11 of Markdent/Event/Image.pm # once (93µs+91µs) by Markdent::Event::StartListItem::BEGIN@9 at line 9 of Markdent/Event/StartListItem.pm # once (91µs+92µs) by Markdent::Dialect::Standard::BlockParser::BEGIN@31 at line 31 of Markdent/Dialect/Standard/BlockParser.pm # once (91µs+92µs) by Markdent::Event::StartLink::BEGIN@11 at line 11 of Markdent/Event/StartLink.pm # once (92µs+91µs) by Markdent::Event::EndBlockquote::BEGIN@9 at line 9 of Markdent/Event/EndBlockquote.pm # once (89µs+94µs) by Markdent::Event::Preformatted::BEGIN@11 at line 11 of Markdent/Event/Preformatted.pm # once (89µs+93µs) by Markdent::Event::HTMLCommentBlock::BEGIN@11 at line 11 of Markdent/Event/HTMLCommentBlock.pm # once (89µs+93µs) by Markdent::Event::HTMLBlock::BEGIN@11 at line 11 of Markdent/Event/HTMLBlock.pm # once (92µs+90µs) by Markdent::Role::AnyParser::BEGIN@9 at line 9 of Markdent/Role/AnyParser.pm # once (89µs+92µs) by Markdent::Event::EndHTMLTag::BEGIN@11 at line 11 of Markdent/Event/EndHTMLTag.pm # once (88µs+92µs) by Markdent::Event::HTMLComment::BEGIN@11 at line 11 of Markdent/Event/HTMLComment.pm # once (91µs+90µs) by Markdent::Event::StartDocument::BEGIN@9 at line 9 of Markdent/Event/StartDocument.pm # once (91µs+90µs) by Markdent::Event::StartBlockquote::BEGIN@9 at line 9 of Markdent/Event/StartBlockquote.pm # once (92µs+89µs) by Markdent::Event::HorizontalRule::BEGIN@9 at line 9 of Markdent/Event/HorizontalRule.pm # once (92µs+88µs) by Markdent::Role::SpanParser::BEGIN@9 at line 9 of Markdent/Role/SpanParser.pm # once (88µs+92µs) by Markdent::Event::StartHTMLTag::BEGIN@11 at line 11 of Markdent/Event/StartHTMLTag.pm # once (87µs+93µs) by Markdent::Event::StartEmphasis::BEGIN@11 at line 11 of Markdent/Event/StartEmphasis.pm # once (88µs+92µs) by Markdent::Event::StartCode::BEGIN@11 at line 11 of Markdent/Event/StartCode.pm # once (87µs+92µs) by Markdent::Event::StartHeader::BEGIN@11 at line 11 of Markdent/Event/StartHeader.pm # once (89µs+91µs) by Markdent::Event::AutoLink::BEGIN@11 at line 11 of Markdent/Event/AutoLink.pm # once (91µs+89µs) by Markdent::Event::StartUnorderedList::BEGIN@9 at line 9 of Markdent/Event/StartUnorderedList.pm # once (90µs+90µs) by Markdent::Role::BlockParser::BEGIN@9 at line 9 of Markdent/Role/BlockParser.pm # once (90µs+90µs) by Markdent::Event::EndParagraph::BEGIN@9 at line 9 of Markdent/Event/EndParagraph.pm # once (88µs+91µs) by Markdent::Event::HTMLTag::BEGIN@11 at line 11 of Markdent/Event/HTMLTag.pm # once (88µs+91µs) by Markdent::Event::EndStrong::BEGIN@11 at line 11 of Markdent/Event/EndStrong.pm # once (86µs+92µs) by Markdent::Role::DebugPrinter::BEGIN@11 at line 11 of Markdent/Role/DebugPrinter.pm # once (88µs+91µs) by Markdent::Dialect::Standard::SpanParser::BEGIN@31 at line 31 of Markdent/Dialect/Standard/SpanParser.pm # once (89µs+90µs) by Markdent::Event::EndDocument::BEGIN@9 at line 9 of Markdent/Event/EndDocument.pm # once (87µs+91µs) by Markdent::Event::EndHeader::BEGIN@11 at line 11 of Markdent/Event/EndHeader.pm # once (88µs+90µs) by Markdent::Role::BalancedEvent::BEGIN@13 at line 13 of Markdent/Role/BalancedEvent.pm # once (89µs+88µs) by Markdent::Role::Handler::BEGIN@9 at line 9 of Markdent/Role/Handler.pm # once (89µs+88µs) by Markdent::Event::EndListItem::BEGIN@9 at line 9 of Markdent/Event/EndListItem.pm # once (90µs+87µs) by Markdent::Role::EventsAsMethods::BEGIN@11 at line 11 of Markdent/Role/EventsAsMethods.pm # once (86µs+89µs) by Markdent::Role::HTMLStream::BEGIN@17 at line 17 of Markdent/Role/HTMLStream.pm # once (87µs+82µs) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 11 of Markdent/Handler/HTMLStream/Document.pm
sub import {
202945.03ms 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 };
28
29 my $runtest = sub {
30 my ($code, $method_name) = @_;
31 local $_ = $method_name;
32 return $code->();
33 };
34
35 my $cleanee = exists $args{-cleanee} ? $args{-cleanee} : scalar caller;
36
37 my @also = map { $subcast->($_) } (
38 exists $args{-also}
39 ? (ref $args{-also} eq 'ARRAY' ? @{ $args{-also} } : $args{-also})
40 : ()
41 );
42
43
# spent 943ms (15.1+928) within namespace::autoclean::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/autoclean.pm:57] which was called 49 times, avg 19.2ms/call: # 49 times (15.1ms+928ms) by B::Hooks::EndOfScope::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/B/Hooks/EndOfScope.pm:26] at line 26 of B/Hooks/EndOfScope.pm, avg 19.2ms/call
on_scope_end {
4468118.7ms492.86ms my $meta = Class::MOP::Class->initialize($cleanee);
# spent 2.86ms making 49 calls to Class::MOP::Class::initialize, avg 58µs/call
4549254ms my %methods = map { ($_ => 1) } $meta->get_method_list;
# spent 254ms making 49 calls to Class::MOP::Mixin::HasMethods::get_method_list, avg 5.18ms/call
46591.22ms $methods{meta} = 1 if $meta->isa('Moose::Meta::Role') && Moose->VERSION < 0.90;
# spent 744µs making 49 calls to UNIVERSAL::isa, avg 15µs/call # spent 471µs making 10 calls to UNIVERSAL::VERSION, avg 47µs/call
47 my %extra = ();
48
49 for my $method (keys %methods) {
50 next if exists $extra{$_};
51169816µs next unless first { $runtest->($_, $method) } @also;
# spent 816µs making 169 calls to List::Util::first, avg 5µs/call
52 $extra{ $method } = 1;
53 }
54
55491.93ms my @symbols = keys %{ $meta->get_all_package_symbols('CODE') };
# spent 1.93ms making 49 calls to Class::MOP::Package::get_all_package_symbols, avg 39µs/call
5649667ms namespace::clean->clean_subroutines($cleanee, keys %extra, grep { !$methods{$_} } @symbols);
# spent 667ms making 49 calls to namespace::clean::clean_subroutines, avg 13.6ms/call
57494.65ms };
# spent 4.65ms making 49 calls to B::Hooks::EndOfScope::on_scope_end, avg 95µs/call
58}
59
60111µs1;
61
62138µs12.03ms__END__