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

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/autoclean.pm
StatementsExecuted 996 statements in 23.8ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
491116.4ms521msnamespace::autoclean::::__ANON__[:57] namespace::autoclean::__ANON__[:57]
4949494.72ms9.44msnamespace::autoclean::::import namespace::autoclean::import
11176µs94µsMarkdent::Handler::HTMLStream::Document::::BEGIN@1Markdent::Handler::HTMLStream::Document::BEGIN@1
11175µs236µsnamespace::autoclean::::BEGIN@15 namespace::autoclean::BEGIN@15
11171µs749µsnamespace::autoclean::::BEGIN@16 namespace::autoclean::BEGIN@16
11147µs109µsnamespace::autoclean::::BEGIN@13 namespace::autoclean::BEGIN@13
11141µs109µsMarkdent::Handler::HTMLStream::Document::::BEGIN@2.3Markdent::Handler::HTMLStream::Document::BEGIN@2.3
11138µs1.14msnamespace::autoclean::::BEGIN@14 namespace::autoclean::BEGIN@14
11118µs18µsnamespace::autoclean::::BEGIN@5 namespace::autoclean::BEGIN@5
11117µs17µ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
13107µs2113µs
# spent 94µs (76+19) within Markdent::Handler::HTMLStream::Document::BEGIN@1 which was called: # once (76µs+19µs) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 1
use strict;
# spent 94µs making 1 call to Markdent::Handler::HTMLStream::Document::BEGIN@1 # spent 19µs making 1 call to strict::import
23161µs2177µs
# spent 109µs (41+68) within Markdent::Handler::HTMLStream::Document::BEGIN@2.3 which was called: # once (41µs+68µs) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 2
use warnings;
# spent 109µs making 1 call to Markdent::Handler::HTMLStream::Document::BEGIN@2.3 # spent 68µ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 {
6185µs $namespace::autoclean::AUTHORITY = 'cpan:FLORA';
7191µs118µs}
# spent 18µs making 1 call to namespace::autoclean::BEGIN@5
8
# spent 17µs within namespace::autoclean::BEGIN@8 which was called: # once (17µs+0s) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 10
BEGIN {
9120µs $namespace::autoclean::VERSION = '0.11';
10181µs117µs}
# spent 17µs making 1 call to namespace::autoclean::BEGIN@8
11# ABSTRACT: Keep imports out of your namespace
12
133180µs2172µ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
143183µs22.24ms
# 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]
153119µs2397µs
# spent 236µs (75+161) within namespace::autoclean::BEGIN@15 which was called: # once (75µs+161µs) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 15
use List::Util qw( first );
# spent 236µs making 1 call to namespace::autoclean::BEGIN@15 # spent 161µs making 1 call to Exporter::import
1631.47ms31.43ms
# spent 749µs (71+678) within namespace::autoclean::BEGIN@16 which was called: # once (71µs+678µs) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 16
use namespace::clean 0.11;
# spent 749µs making 1 call to namespace::autoclean::BEGIN@16 # spent 619µs making 1 call to namespace::clean::import # spent 59µs making 1 call to UNIVERSAL::VERSION
17
18
19
# spent 9.44ms (4.72+4.72) within namespace::autoclean::import which was called 49 times, avg 193µs/call: # once (117µs+160µs) by Markdent::Event::EndOrderedList::BEGIN@9 at line 9 of Markdent/Event/EndOrderedList.pm # once (131µs+132µs) by Markdent::Event::StartBlockquote::BEGIN@9 at line 9 of Markdent/Event/StartBlockquote.pm # once (91µs+168µs) by Markdent::Event::AutoLink::BEGIN@11 at line 11 of Markdent/Event/AutoLink.pm # once (109µs+121µs) by Markdent::Event::EndBlockquote::BEGIN@9 at line 9 of Markdent/Event/EndBlockquote.pm # once (119µs+111µs) by Markdent::Parser::BEGIN@16 at line 16 of Markdent/Parser.pm # once (125µs+94µs) by Markdent::Event::EndParagraph::BEGIN@9 at line 9 of Markdent/Event/EndParagraph.pm # once (126µs+92µs) by Markdent::Event::EndHeader::BEGIN@11 at line 11 of Markdent/Event/EndHeader.pm # once (108µs+106µs) by Markdent::Event::EndDocument::BEGIN@9 at line 9 of Markdent/Event/EndDocument.pm # once (120µs+90µs) by Markdent::Role::EventsAsMethods::BEGIN@11 at line 11 of Markdent/Role/EventsAsMethods.pm # once (115µs+90µs) by Markdent::Event::StartDocument::BEGIN@9 at line 9 of Markdent/Event/StartDocument.pm # once (112µs+91µs) by Markdent::Event::EndUnorderedList::BEGIN@9 at line 9 of Markdent/Event/EndUnorderedList.pm # once (90µs+110µs) by Markdent::Event::StartParagraph::BEGIN@9 at line 9 of Markdent/Event/StartParagraph.pm # once (108µs+91µs) by Markdent::Event::StartUnorderedList::BEGIN@9 at line 9 of Markdent/Event/StartUnorderedList.pm # once (102µs+95µs) by Markdent::Role::EventAsText::BEGIN@9 at line 9 of Markdent/Role/EventAsText.pm # once (96µs+93µs) by Markdent::Event::HorizontalRule::BEGIN@9 at line 9 of Markdent/Event/HorizontalRule.pm # once (94µs+93µs) by Markdent::Event::StartCode::BEGIN@11 at line 11 of Markdent/Event/StartCode.pm # once (92µs+94µs) by Markdent::Event::StartEmphasis::BEGIN@11 at line 11 of Markdent/Event/StartEmphasis.pm # once (92µs+93µs) by Markdent::Event::HTMLBlock::BEGIN@11 at line 11 of Markdent/Event/HTMLBlock.pm # once (93µs+91µs) by Markdent::Role::AnyParser::BEGIN@9 at line 9 of Markdent/Role/AnyParser.pm # once (92µs+91µs) by Markdent::Event::EndStrong::BEGIN@11 at line 11 of Markdent/Event/EndStrong.pm # once (95µs+89µs) by Markdent::Event::EndLink::BEGIN@9 at line 9 of Markdent/Event/EndLink.pm # once (89µs+94µs) by Markdent::Role::DebugPrinter::BEGIN@11 at line 11 of Markdent/Role/DebugPrinter.pm # once (90µs+93µs) by Markdent::Dialect::Standard::BlockParser::BEGIN@31 at line 31 of Markdent/Dialect/Standard/BlockParser.pm # once (92µs+90µs) by Markdent::Event::HTMLEntity::BEGIN@11 at line 11 of Markdent/Event/HTMLEntity.pm # once (93µs+89µs) by Markdent::Dialect::Standard::SpanParser::BEGIN@31 at line 31 of Markdent/Dialect/Standard/SpanParser.pm # once (93µs+89µs) by Markdent::Role::SpanParser::BEGIN@9 at line 9 of Markdent/Role/SpanParser.pm # once (91µs+90µs) by Markdent::Role::BlockParser::BEGIN@9 at line 9 of Markdent/Role/BlockParser.pm # once (90µs+91µs) by Markdent::Event::StartLink::BEGIN@11 at line 11 of Markdent/Event/StartLink.pm # once (90µs+91µs) by Markdent::Event::EndHTMLTag::BEGIN@11 at line 11 of Markdent/Event/EndHTMLTag.pm # once (91µs+89µs) by Markdent::Event::StartListItem::BEGIN@9 at line 9 of Markdent/Event/StartListItem.pm # once (89µs+91µs) by Markdent::Simple::Document::BEGIN@14 at line 14 of Markdent/Simple/Document.pm # once (88µs+91µs) by Markdent::Event::EndCode::BEGIN@11 at line 11 of Markdent/Event/EndCode.pm # once (90µs+90µs) by Markdent::Event::StartOrderedList::BEGIN@9 at line 9 of Markdent/Event/StartOrderedList.pm # once (87µs+92µs) by Markdent::Event::StartHTMLTag::BEGIN@11 at line 11 of Markdent/Event/StartHTMLTag.pm # once (88µs+91µs) by Markdent::Event::HTMLCommentBlock::BEGIN@11 at line 11 of Markdent/Event/HTMLCommentBlock.pm # once (88µs+91µs) by Markdent::Event::EndEmphasis::BEGIN@11 at line 11 of Markdent/Event/EndEmphasis.pm # once (88µs+91µs) by Markdent::Event::Text::BEGIN@11 at line 11 of Markdent/Event/Text.pm # once (88µs+91µs) by Markdent::Event::HTMLTag::BEGIN@11 at line 11 of Markdent/Event/HTMLTag.pm # once (87µs+91µs) by Markdent::Event::Image::BEGIN@11 at line 11 of Markdent/Event/Image.pm # once (89µs+89µs) by Markdent::Role::Event::BEGIN@9 at line 9 of Markdent/Role/Event.pm # once (87µs+91µs) by Markdent::Event::Preformatted::BEGIN@11 at line 11 of Markdent/Event/Preformatted.pm # once (88µs+91µs) by Markdent::Event::StartStrong::BEGIN@11 at line 11 of Markdent/Event/StartStrong.pm # once (87µs+90µs) by Markdent::Event::HTMLComment::BEGIN@11 at line 11 of Markdent/Event/HTMLComment.pm # once (89µs+88µs) by Markdent::Role::Handler::BEGIN@9 at line 9 of Markdent/Role/Handler.pm # once (90µs+87µs) by Markdent::Event::EndListItem::BEGIN@9 at line 9 of Markdent/Event/EndListItem.pm # once (88µs+89µs) by Markdent::Role::BalancedEvent::BEGIN@13 at line 13 of Markdent/Role/BalancedEvent.pm # once (86µs+90µs) by Markdent::Role::HTMLStream::BEGIN@17 at line 17 of Markdent/Role/HTMLStream.pm # once (87µs+89µs) by Markdent::Event::StartHeader::BEGIN@11 at line 11 of Markdent/Event/StartHeader.pm # once (89µs+85µs) by Markdent::Handler::HTMLStream::Document::BEGIN@11 at line 11 of Markdent/Handler/HTMLStream/Document.pm
sub import {
202945.08ms 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 521ms (16.4+505) 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 10.6ms/call: # 49 times (16.4ms+505ms) 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 10.6ms/call
on_scope_end {
4434310.2ms492.94ms my $meta = Class::MOP::Class->initialize($cleanee);
# spent 2.94ms making 49 calls to Class::MOP::Class::initialize, avg 60µs/call
4549230ms my %methods = map { ($_ => 1) } $meta->get_method_list;
# spent 230ms making 49 calls to Class::MOP::Mixin::HasMethods::get_method_list, avg 4.69ms/call
46591.10ms $methods{meta} = 1 if $meta->isa('Moose::Meta::Role') && Moose->VERSION < 0.90;
# spent 669µs making 49 calls to UNIVERSAL::isa, avg 14µs/call # spent 430µs making 10 calls to UNIVERSAL::VERSION, avg 43µs/call
47 my %extra = ();
48
49 for my $method (keys %methods) {
503385.98ms next if exists $extra{$_};
51169877µs next unless first { $runtest->($_, $method) } @also;
# spent 877µs making 169 calls to List::Util::first, avg 5µs/call
52 $extra{ $method } = 1;
53 }
54
55494.74ms my @symbols = keys %{ $meta->get_all_package_symbols('CODE') };
# spent 4.74ms making 49 calls to Class::MOP::Package::get_all_package_symbols, avg 97µs/call
5649265ms namespace::clean->clean_subroutines($cleanee, keys %extra, grep { !$methods{$_} } @symbols);
# spent 265ms making 49 calls to namespace::clean::clean_subroutines, avg 5.41ms/call
57494.72ms };
# spent 4.72ms making 49 calls to B::Hooks::EndOfScope::on_scope_end, avg 96µs/call
58}
59
60110µs1;
61
62136µs1871µs__END__