| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/namespace/autoclean.pm |
| Statements | Executed 996 statements in 23.8ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 49 | 1 | 1 | 16.4ms | 521ms | namespace::autoclean::__ANON__[:57] |
| 49 | 49 | 49 | 4.72ms | 9.44ms | namespace::autoclean::import |
| 1 | 1 | 1 | 76µs | 94µs | Markdent::Handler::HTMLStream::Document::BEGIN@1 |
| 1 | 1 | 1 | 75µs | 236µs | namespace::autoclean::BEGIN@15 |
| 1 | 1 | 1 | 71µs | 749µs | namespace::autoclean::BEGIN@16 |
| 1 | 1 | 1 | 47µs | 109µs | namespace::autoclean::BEGIN@13 |
| 1 | 1 | 1 | 41µs | 109µs | Markdent::Handler::HTMLStream::Document::BEGIN@2.3 |
| 1 | 1 | 1 | 38µs | 1.14ms | namespace::autoclean::BEGIN@14 |
| 1 | 1 | 1 | 18µs | 18µs | namespace::autoclean::BEGIN@5 |
| 1 | 1 | 1 | 17µs | 17µs | namespace::autoclean::BEGIN@8 |
| 0 | 0 | 0 | 0s | 0s | namespace::autoclean::__ANON__[:25] |
| 0 | 0 | 0 | 0s | 0s | namespace::autoclean::__ANON__[:26] |
| 0 | 0 | 0 | 0s | 0s | namespace::autoclean::__ANON__[:27] |
| 0 | 0 | 0 | 0s | 0s | namespace::autoclean::__ANON__[:33] |
| 0 | 0 | 0 | 0s | 0s | namespace::autoclean::__ANON__[:51] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | 3 | 107µs | 2 | 113µ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 # spent 94µs making 1 call to Markdent::Handler::HTMLStream::Document::BEGIN@1
# spent 19µs making 1 call to strict::import |
| 2 | 3 | 161µs | 2 | 177µ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 # spent 109µs making 1 call to Markdent::Handler::HTMLStream::Document::BEGIN@2.3
# spent 68µs making 1 call to warnings::import |
| 3 | |||||
| 4 | package 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 | ||||
| 6 | 1 | 85µs | $namespace::autoclean::AUTHORITY = 'cpan:FLORA'; | ||
| 7 | 1 | 91µs | 1 | 18µ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 | ||||
| 9 | 1 | 20µs | $namespace::autoclean::VERSION = '0.11'; | ||
| 10 | 1 | 81µs | 1 | 17µs | } # spent 17µs making 1 call to namespace::autoclean::BEGIN@8 |
| 11 | # ABSTRACT: Keep imports out of your namespace | ||||
| 12 | |||||
| 13 | 3 | 180µs | 2 | 172µ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 # spent 109µs making 1 call to namespace::autoclean::BEGIN@13
# spent 62µs making 1 call to UNIVERSAL::VERSION |
| 14 | 3 | 183µs | 2 | 2.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 # 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] |
| 15 | 3 | 119µs | 2 | 397µ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 # spent 236µs making 1 call to namespace::autoclean::BEGIN@15
# spent 161µs making 1 call to Exporter::import |
| 16 | 3 | 1.47ms | 3 | 1.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 # 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 | ||||
| 20 | 294 | 5.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 | ||||
| 44 | 343 | 10.2ms | 49 | 2.94ms | my $meta = Class::MOP::Class->initialize($cleanee); # spent 2.94ms making 49 calls to Class::MOP::Class::initialize, avg 60µs/call |
| 45 | 49 | 230ms | 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 | ||
| 46 | 59 | 1.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) { | ||||
| 50 | 338 | 5.98ms | next if exists $extra{$_}; | ||
| 51 | 169 | 877µ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 | |||||
| 55 | 49 | 4.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 | ||
| 56 | 49 | 265ms | namespace::clean->clean_subroutines($cleanee, keys %extra, grep { !$methods{$_} } @symbols); # spent 265ms making 49 calls to namespace::clean::clean_subroutines, avg 5.41ms/call | ||
| 57 | 49 | 4.72ms | }; # spent 4.72ms making 49 calls to B::Hooks::EndOfScope::on_scope_end, avg 96µs/call | ||
| 58 | } | ||||
| 59 | |||||
| 60 | 1 | 10µs | 1; | ||
| 61 | |||||
| 62 | 1 | 36µs | 1 | 871µs | __END__ # spent 871µs making 1 call to B::Hooks::EndOfScope::__ANON__[B/Hooks/EndOfScope.pm:26] |