← 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:11:36 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Markdent/Role/Event.pm
StatementsExecuted 766 statements in 20.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
341114.5ms198msMarkdent::Role::Event::::__ANON__[:88]Markdent::Role::Event::__ANON__[:88]
1113.63ms393msMarkdent::Role::Event::::BEGIN@10Markdent::Role::Event::BEGIN@10
65211.12ms1.12msMarkdent::Role::Event::::CORE:matchMarkdent::Role::Event::CORE:match (opcode)
7711734µs734µsMarkdent::Role::Event::::CORE:substcontMarkdent::Role::Event::CORE:substcont (opcode)
6821509µs509µsMarkdent::Role::Event::::CORE:substMarkdent::Role::Event::CORE:subst (opcode)
11149µs49µsMarkdent::Role::Event::::BEGIN@2Markdent::Role::Event::BEGIN@2
11144µs231µsMarkdent::Role::Event::::BEGIN@9Markdent::Role::Event::BEGIN@9
11138µs55µsMarkdent::Role::Event::::BEGIN@6Markdent::Role::Event::BEGIN@6
11138µs106µsMarkdent::Role::Event::::BEGIN@7Markdent::Role::Event::BEGIN@7
0000s0sMarkdent::Role::Event::::__ANON__[:27]Markdent::Role::Event::__ANON__[:27]
0000s0sMarkdent::Role::Event::::__ANON__[:29]Markdent::Role::Event::__ANON__[:29]
0000s0sMarkdent::Role::Event::::__ANON__[:32]Markdent::Role::Event::__ANON__[:32]
0000s0sMarkdent::Role::Event::::__ANON__[:35]Markdent::Role::Event::__ANON__[:35]
0000s0sMarkdent::Role::Event::::__ANON__[:38]Markdent::Role::Event::__ANON__[:38]
0000s0sMarkdent::Role::Event::::__ANON__[:87]Markdent::Role::Event::__ANON__[:87]
0000s0sMarkdent::Role::Event::::_debug_valueMarkdent::Role::Event::_debug_value
0000s0sMarkdent::Role::Event::::debug_dumpMarkdent::Role::Event::debug_dump
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Markdent::Role::Event;
2
# spent 49µs within Markdent::Role::Event::BEGIN@2 which was called: # once (49µs+0s) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 4
BEGIN {
3130µs $Markdent::Role::Event::VERSION = '0.17';
4176µs149µs}
# spent 49µs making 1 call to Markdent::Role::Event::BEGIN@2
5
6394µs272µs
# spent 55µs (38+17) within Markdent::Role::Event::BEGIN@6 which was called: # once (38µs+17µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 6
use strict;
# spent 55µs making 1 call to Markdent::Role::Event::BEGIN@6 # spent 17µs making 1 call to strict::import
7399µs2175µs
# spent 106µs (38+69) within Markdent::Role::Event::BEGIN@7 which was called: # once (38µs+69µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 7
use warnings;
# spent 106µs making 1 call to Markdent::Role::Event::BEGIN@7 # spent 69µs making 1 call to warnings::import
8
93117µs2417µs
# spent 231µs (44+187) within Markdent::Role::Event::BEGIN@9 which was called: # once (44µs+187µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 9
use namespace::autoclean;
# spent 231µs making 1 call to Markdent::Role::Event::BEGIN@9 # spent 187µs making 1 call to namespace::autoclean::import
1033.35ms2416ms
# spent 393ms (3.63+389) within Markdent::Role::Event::BEGIN@10 which was called: # once (3.63ms+389ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 10
use MooseX::Role::Parameterized;
# spent 393ms making 1 call to Markdent::Role::Event::BEGIN@10 # spent 23.8ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456]
11
12
# spent 198ms (14.5+183) within Markdent::Role::Event::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Markdent/Role/Event.pm:88] which was called 34 times, avg 5.81ms/call: # 34 times (14.5ms+183ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::generate_role at line 94 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm, avg 5.81ms/call
role {
1364613.4ms shift;
14 my %extra = @_;
15
1634272µs my $class = $extra{consumer}->name();
# spent 272µs making 34 calls to Class::MOP::Package::name, avg 8µs/call
17
1834987µs my ( $type, $name ) = $class =~ /::(Start|End)?(\w+)$/;
# spent 987µs making 34 calls to Markdent::Role::Event::CORE:match, avg 29µs/call
19
20 # It's easier to hack this in rather than trying to find a general
21 # case for upper-case abbreviations in class names.
2234151µs $name =~ s/HTML/html/;
# spent 151µs making 34 calls to Markdent::Role::Event::CORE:subst, avg 4µs/call
23
241111.09ms $name =~ s/(^|.)([A-Z])/$1 ? "$1\L_$2" : "\L$2"/ge;
# spent 734µs making 77 calls to Markdent::Role::Event::CORE:substcont, avg 10µs/call # spent 358µs making 34 calls to Markdent::Role::Event::CORE:subst, avg 11µs/call
25
26 my $event_name = join q{_}, map {lc} grep {defined} $type, $name;
273428.9ms method event_name => sub {$event_name};
# spent 28.9ms making 34 calls to MooseX::Role::Parameterized::method, avg 850µs/call
28
293426.6ms method name => sub {$name};
# spent 26.6ms making 34 calls to MooseX::Role::Parameterized::method, avg 783µs/call
30
31 my $is_start = ( $type || q{} ) eq 'Start';
323426.5ms method is_start => sub {$is_start};
# spent 26.5ms making 34 calls to MooseX::Role::Parameterized::method, avg 778µs/call
33
34 my $is_end = ( $type || q{} ) eq 'End';
353427.0ms method is_end => sub {$is_end};
# spent 27.0ms making 34 calls to MooseX::Role::Parameterized::method, avg 795µs/call
36
37 my $is_inline = ! defined $type;
383426.5ms method is_inline => sub {$is_inline};
# spent 26.5ms making 34 calls to MooseX::Role::Parameterized::method, avg 779µs/call
39
40 my @required;
41 my @optional;
42
43311.04ms13015.1ms for my $attr ( grep { $_->name() !~ /^_/ }
# spent 11.4ms making 34 calls to Class::MOP::Class::get_all_attributes, avg 334µs/call # spent 183µs making 31 calls to Class::MOP::Mixin::AttributeCore::name, avg 6µs/call # spent 133µs making 31 calls to Markdent::Role::Event::CORE:match, avg 4µs/call # spent 129µs making 1 call to Markdent::Event::StartParagraph::meta # spent 125µs making 1 call to Markdent::Event::StartLink::meta # spent 102µs making 1 call to Markdent::Event::HTMLBlock::meta # spent 101µs making 1 call to Markdent::Event::HTMLCommentBlock::meta # spent 101µs making 1 call to Markdent::Event::StartHTMLTag::meta # spent 101µs making 1 call to Markdent::Event::StartCode::meta # spent 100µs making 1 call to Markdent::Event::Preformatted::meta # spent 100µs making 1 call to Markdent::Event::StartUnorderedList::meta # spent 100µs making 1 call to Markdent::Event::StartOrderedList::meta # spent 100µs making 1 call to Markdent::Event::EndUnorderedList::meta # spent 100µs making 1 call to Markdent::Event::EndHTMLTag::meta # spent 100µs making 1 call to Markdent::Event::HTMLEntity::meta # spent 100µs making 1 call to Markdent::Event::EndStrong::meta # spent 99µs making 1 call to Markdent::Event::HTMLComment::meta # spent 99µs making 1 call to Markdent::Event::StartBlockquote::meta # spent 99µs making 1 call to Markdent::Event::EndEmphasis::meta # spent 99µs making 1 call to Markdent::Event::Text::meta # spent 99µs making 1 call to Markdent::Event::EndHeader::meta # spent 99µs making 1 call to Markdent::Event::EndListItem::meta # spent 99µs making 1 call to Markdent::Event::EndParagraph::meta # spent 99µs making 1 call to Markdent::Event::EndDocument::meta # spent 99µs making 1 call to Markdent::Event::EndBlockquote::meta # spent 99µs making 1 call to Markdent::Event::AutoLink::meta # spent 99µs making 1 call to Markdent::Event::Image::meta # spent 98µs making 1 call to Markdent::Event::EndOrderedList::meta # spent 98µs making 1 call to Markdent::Event::HorizontalRule::meta # spent 98µs making 1 call to Markdent::Event::EndLink::meta # spent 98µs making 1 call to Markdent::Event::StartEmphasis::meta # spent 98µs making 1 call to Markdent::Event::EndCode::meta # spent 98µs making 1 call to Markdent::Event::StartListItem::meta # spent 98µs making 1 call to Markdent::Event::StartStrong::meta # spent 97µs making 1 call to Markdent::Event::HTMLTag::meta # spent 97µs making 1 call to Markdent::Event::StartDocument::meta # spent 97µs making 1 call to Markdent::Event::StartHeader::meta
44 $class->meta()->get_all_attributes() ) {
45
46581.45ms29138µs my $name = $attr->name();
# spent 138µs making 29 calls to Class::MOP::Mixin::AttributeCore::name, avg 5µs/call
47
4816334µs501.33ms if ( $attr->is_required() ) {
# spent 913µs making 21 calls to Class::MOP::Attribute::get_read_method, avg 43µs/call # spent 417µs making 29 calls to Moose::Meta::Mixin::AttributeCore::is_required, avg 14µs/call
49 push @required, [ $name, $attr->get_read_method() ];
50 }
51 else {
5212130µs die
# spent 84µs making 8 calls to Class::MOP::Mixin::AttributeCore::has_predicate, avg 10µs/call # spent 46µs making 4 calls to Class::MOP::Mixin::AttributeCore::has_default, avg 11µs/call
53 "All optional attributes for an event must have a predicate or default value ($class - $name)"
54 unless $attr->has_predicate()
55 || $attr->has_default()
56 || $attr->has_builder();
57
5816359µs push @optional,
# spent 285µs making 8 calls to Class::MOP::Attribute::get_read_method, avg 36µs/call # spent 74µs making 8 calls to Class::MOP::Mixin::AttributeCore::predicate, avg 9µs/call
59 [
60 $name,
61 $attr->get_read_method(),
62 $attr->predicate()
63 ];
64 }
65 }
66
67 method kv_pairs_for_attributes => sub {
68 my $event = shift;
69
70 my %p;
71
72 for my $pair (@required) {
73 my ( $name, $reader ) = @{$pair};
74
75 $p{$name} = $event->$reader();
76 }
77
78 for my $triplet (@optional) {
79 my ( $name, $reader, $pred ) = @{$triplet};
80
81 next if $pred && ! $event->$pred();
82
83 $p{$name} = $event->$name();
84 }
85
86 return %p;
873428.0ms };
# spent 28.0ms making 34 calls to MooseX::Role::Parameterized::method, avg 823µs/call
88130µs1187µs};
# spent 187µs making 1 call to MooseX::Role::Parameterized::role
89
90sub debug_dump {
91 my $self = shift;
92
93 my $dump = ' - ' . $self->event_name() . "\n";
94
95 for my $attr ( sort { $a->name() cmp $b->name() }
96 $self->meta()->get_all_attributes() ) {
97 my $name = $attr->name();
98 my $reader = $attr->get_read_method();
99 my $pred = $attr->predicate();
100
101 next if $pred && !$self->$pred();
102
103 my $val = $self->$reader();
104
105 if ( ref $val && ref $val eq 'ARRAY' ) {
106 $dump .= sprintf( ' %-16s: |%s|', $name, $val->[0] );
107 $dump .= "\n";
108
109 for my $v ( @{$val}[ 1 .. $#{$val} ] ) {
110 $self->_debug_value($v);
111
112 $dump .= q{ } x 22;
113 $dump .= "|$v|\n";
114 }
115 }
116 elsif ( ref $val && ref $val eq 'HASH' ) {
117 $dump .= sprintf( ' %-16s:', $name );
118 $dump .= "\n";
119
120 for my $k ( sort keys %{$val} ) {
121 $dump .= q{ } x 22;
122 $dump .= sprintf(
123 '%-16s: %s', $k,
124 $self->_debug_value( $val->{$k} )
125 );
126 $dump .= "\n";
127 }
128 }
129 else {
130 $dump .= sprintf( ' %-16s: %s', $name,
131 $self->_debug_value($val) );
132 $dump .= "\n";
133 }
134 }
135
136 return $dump;
137}
138
139sub _debug_value {
140 return defined $_[1] ? $_[1] : '<undef>';
141}
142
143124µs1;
144
145# ABSTRACT: Implements behavior shared by all events
146
- -
149=pod
150
- -
210159µs121.0ms__END__
 
# spent 1.12ms within Markdent::Role::Event::CORE:match which was called 65 times, avg 17µs/call: # 34 times (987µs+0s) by Markdent::Role::Event::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Markdent/Role/Event.pm:88] at line 18, avg 29µs/call # 31 times (133µs+0s) by Markdent::Role::Event::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Markdent/Role/Event.pm:88] at line 43, avg 4µs/call
sub Markdent::Role::Event::CORE:match; # opcode
# spent 509µs within Markdent::Role::Event::CORE:subst which was called 68 times, avg 7µs/call: # 34 times (358µs+0s) by Markdent::Role::Event::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Markdent/Role/Event.pm:88] at line 24, avg 11µs/call # 34 times (151µs+0s) by Markdent::Role::Event::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Markdent/Role/Event.pm:88] at line 22, avg 4µs/call
sub Markdent::Role::Event::CORE:subst; # opcode
# spent 734µs within Markdent::Role::Event::CORE:substcont which was called 77 times, avg 10µs/call: # 77 times (734µs+0s) by Markdent::Role::Event::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Markdent/Role/Event.pm:88] at line 24, avg 10µs/call
sub Markdent::Role::Event::CORE:substcont; # opcode