← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/bin/epoll_server.pl
  Run on Wed Jan 5 05:34:33 2011
Reported on Wed Jan 5 05:41:41 2011

File /usr/lib/perl5/vendor_perl/5.10.1/Catalyst/Action.pm
Statements Executed 138
Statement Execution Time 4.48ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1342839µs19.0sCatalyst::Action::::dispatchCatalyst::Action::dispatch
52106637µs637µsCatalyst::Action::::__ANON__[:44]Catalyst::Action::__ANON__[:44]
1311498µs19.0sCatalyst::Action::::executeCatalyst::Action::execute
111141µs273µsCatalyst::Action::::BEGIN@41Catalyst::Action::BEGIN@41
11183µs115µsCatalyst::Action::::compareCatalyst::Action::compare
11152µs14.7msCatalyst::Action::::BEGIN@22Catalyst::Action::BEGIN@22
11145µs2.11msCatalyst::Action::::BEGIN@25Catalyst::Action::BEGIN@25
11134µs151µsCatalyst::Action::::BEGIN@23Catalyst::Action::BEGIN@23
11131µs85µsCatalyst::Action::::BEGIN@56Catalyst::Action::BEGIN@56
11124µs35µsCatalyst::Action::::matchCatalyst::Action::match
0000s0sCatalyst::Action::::__ANON__[:38]Catalyst::Action::__ANON__[:38]
0000s0sCatalyst::Action::::__ANON__[:47]Catalyst::Action::__ANON__[:47]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Catalyst::Action;
2
3=head1 NAME
4
5Catalyst::Action - Catalyst Action
6
7=head1 SYNOPSIS
8
9 <form action="[%c.uri_for(c.action)%]">
10
11 $c->forward( $action->private_path );
12
13=head1 DESCRIPTION
14
15This class represents a Catalyst Action. You can access the object for the
16currently dispatched action via $c->action. See the L<Catalyst::Dispatcher>
17for more information on how actions are dispatched. Actions are defined in
18L<Catalyst::Controller> subclasses.
19
20=cut
21
223118µs229.4ms
# spent 14.7ms (52µs+14.7) within Catalyst::Action::BEGIN@22 which was called # once (52µs+14.7ms) by Catalyst::Dispatcher::BEGIN@9 at line 22
use Moose;
# spent 14.7ms making 1 call to Catalyst::Action::BEGIN@22 # spent 14.7ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:389]
233115µs2269µs
# spent 151µs (34+117) within Catalyst::Action::BEGIN@23 which was called # once (34µs+117µs) by Catalyst::Dispatcher::BEGIN@9 at line 23
use Scalar::Util 'looks_like_number';
# spent 151µs making 1 call to Catalyst::Action::BEGIN@23 # spent 117µs making 1 call to Exporter::import
2419µs134.6mswith 'MooseX::Emulate::Class::Accessor::Fast';
# spent 34.6ms making 1 call to Moose::with
253729µs24.17ms
# spent 2.11ms (45µs+2.06) within Catalyst::Action::BEGIN@25 which was called # once (45µs+2.06ms) by Catalyst::Dispatcher::BEGIN@9 at line 25
use namespace::clean -except => 'meta';
# spent 2.11ms making 1 call to Catalyst::Action::BEGIN@25 # spent 2.06ms making 1 call to namespace::clean::import
26
2718µs18.23mshas class => (is => 'rw');
# spent 8.23ms making 1 call to Moose::has
2818µs16.25mshas namespace => (is => 'rw');
# spent 6.25ms making 1 call to Moose::has
2918µs16.34mshas 'reverse' => (is => 'rw');
# spent 6.34ms making 1 call to Moose::has
3017µs16.17mshas attributes => (is => 'rw');
# spent 6.17ms making 1 call to Moose::has
3118µs16.08mshas name => (is => 'rw');
# spent 6.08ms making 1 call to Moose::has
3218µs16.62mshas code => (is => 'rw');
# spent 6.62ms making 1 call to Moose::has
33has private_path => (
34 reader => 'private_path',
35 isa => 'Str',
36 lazy => 1,
37 required => 1,
38 default => sub { '/'.shift->reverse },
39118µs17.02ms);
# spent 7.02ms making 1 call to Moose::has
40
41
# spent 273µs (141+132) within Catalyst::Action::BEGIN@41 which was called # once (141µs+132µs) by Catalyst::Dispatcher::BEGIN@9 at line 52
use overload (
42
43 # Stringify to reverse for debug output etc.
44521.04ms
# spent 637µs within Catalyst::Action::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Catalyst/Action.pm:44] which was called 52 times, avg 12µs/call: # 15 times (92µs+0s) by Catalyst::_stats_start_execute at line 1692 of Catalyst.pm, avg 6µs/call # 10 times (292µs+0s) by Catalyst::Dispatcher::_do_forward at line 246 of Catalyst/Dispatcher.pm, avg 29µs/call # 9 times (76µs+0s) by Catalyst::DispatchType::Regex::list at line 58 of Catalyst/DispatchType/Regex.pm, avg 8µs/call # 6 times (58µs+0s) by Catalyst::Dispatcher::_invoke_as_path at line 294 of Catalyst/Dispatcher.pm, avg 10µs/call # 6 times (55µs+0s) by Catalyst::Dispatcher::_command2action at line 158 of Catalyst/Dispatcher.pm, avg 9µs/call # 2 times (22µs+0s) by Catalyst::DispatchType::Path::list at line 59 of Catalyst/DispatchType/Path.pm, avg 11µs/call # once (11µs+0s) by Catalyst::View::TT::process at line 208 of Catalyst/View/TT.pm # once (11µs+0s) by Catalyst::Dispatcher::dispatch at line 105 of Catalyst/Dispatcher.pm # once (10µs+0s) by Catalyst::Controller::_BEGIN at line 93 of Catalyst/Controller.pm # once (9µs+0s) by Catalyst::Controller::_END at line 122 of Catalyst/Controller.pm
q{""} => sub { shift->{reverse} },
45
46 # Codulate to execute to invoke the encapsulated action coderef
47 '&{}' => sub { my $self = shift; sub { $self->execute(@_); }; },
48
49 # Make general $stuff still work
50178µs1132µs fallback => 1,
# spent 132µs making 1 call to overload::import
51
522123µs1273µs);
# spent 273µs making 1 call to Catalyst::Action::BEGIN@41
53
54
55
563848µs2140µs
# spent 85µs (31+54) within Catalyst::Action::BEGIN@56 which was called # once (31µs+54µs) by Catalyst::Dispatcher::BEGIN@9 at line 56
no warnings 'recursion';
# spent 85µs making 1 call to Catalyst::Action::BEGIN@56 # spent 54µs making 1 call to warnings::unimport
57
58
# spent 19.0s (839µs+19.0) within Catalyst::Action::dispatch which was called 13 times, avg 1.46s/call: # 10 times (471µs+19.0s) by Catalyst::Dispatcher::_do_forward at line 257 of Catalyst/Dispatcher.pm, avg 1.90s/call # once (26µs+-26µs) by Catalyst::Controller::_END at line 123 of Catalyst/Controller.pm # once (205µs+-205µs) by Catalyst::Controller::_BEGIN at line 94 of Catalyst/Controller.pm # once (137µs+-137µs) by Catalyst::Controller::_ACTION at line 110 of Catalyst/Controller.pm
sub dispatch { # Execute ourselves against a context
591334µs my ( $self, $c ) = @_;
6013529µs2619.0s return $c->execute( $self->class, $self );
# spent 75.7s making 13 calls to Catalyst::execute, avg 5.82s/call, recursion: max depth 3, time 56.7s # spent 182µs making 13 calls to Catalyst::Action::class, avg 14µs/call
61}
62
63
# spent 19.0s (498µs+19.0) within Catalyst::Action::execute which was called 13 times, avg 1.46s/call: # 13 times (498µs+19.0s) by Catalyst::execute at line 1629 of Catalyst.pm, avg 1.46s/call
sub execute {
641327µs my $self = shift;
6513533µs2975.7s $self->code->(@_);
# spent 19.0s making 1 call to Catalyst::Controller::_DISPATCH # spent 16.8s making 1 call to Catalyst::Controller::_END # spent 16.8s making 1 call to Epoll::Controller::Admin::end # spent 16.8s making 1 call to Epoll::View::TT::process # spent 2.18s making 1 call to Catalyst::Controller::_ACTION # spent 2.18s making 1 call to Epoll::Controller::Admin::voters # spent 1.77s making 3 calls to Epoll::View::Mail::render, avg 589ms/call # spent 23.5ms making 1 call to Epoll::Controller::Admin::auth # spent 9.70ms making 1 call to Catalyst::Controller::_BEGIN # spent 5.25ms making 1 call to Epoll::Controller::Root::begin # spent 394µs making 1 call to Catalyst::Controller::_AUTO # spent 317µs making 13 calls to Catalyst::Action::code, avg 24µs/call # spent 70µs making 3 calls to Mail::Mailer::DESTROY, avg 23µs/call
66}
67
68
# spent 35µs (24+11) within Catalyst::Action::match which was called # once (24µs+11µs) by Catalyst::DispatchType::Regex::match at line 82 of Catalyst/DispatchType/Regex.pm
sub match {
6913µs my ( $self, $c ) = @_;
70 #would it be unreasonable to store the number of arguments
71 #the action has as its own attribute?
72 #it would basically eliminate the code below. ehhh. small fish
73119µs111µs return 1 unless exists $self->attributes->{Args};
# spent 11µs making 1 call to Catalyst::Action::attributes
74 my $args = $self->attributes->{Args}[0];
75 return 1 unless defined($args) && length($args);
76 return scalar( @{ $c->req->args } ) == $args;
77}
78
79
# spent 115µs (83+33) within Catalyst::Action::compare which was called # once (83µs+33µs) by Catalyst::DispatchType::Path::CORE:sort at line 123 of Catalyst/DispatchType/Path.pm
sub compare {
8013µs my ($a1, $a2) = @_;
81
82110µs18µs my ($a1_args) = @{ $a1->attributes->{Args} || [] };
# spent 8µs making 1 call to Catalyst::Action::attributes
83112µs112µs my ($a2_args) = @{ $a2->attributes->{Args} || [] };
# spent 12µs making 1 call to Catalyst::Action::attributes
84
85 $_ = looks_like_number($_) ? $_ : ~0
86243µs212µs for $a1_args, $a2_args;
# spent 12µs making 2 calls to Scalar::Util::looks_like_number, avg 6µs/call
87
88116µs return $a1_args <=> $a2_args;
89}
90
91117µs214.2ms__PACKAGE__->meta->make_immutable;
# spent 14.1ms making 1 call to Class::MOP::Class::make_immutable # spent 107µs making 1 call to Catalyst::Action::meta
92
93167µs1;
94
95137µs12.04ms__END__
96
97=head1 METHODS
98
99=head2 attributes
100
101The sub attributes that are set for this action, like Local, Path, Private
102and so on. This determines how the action is dispatched to.
103
104=head2 class
105
106Returns the name of the component where this action is defined.
107Derived by calling the L<Catalyst::Component/catalyst_component_name|catalyst_component_name>
108method on each component.
109
110=head2 code
111
112Returns a code reference to this action.
113
114=head2 dispatch( $c )
115
116Dispatch this action against a context.
117
118=head2 execute( $controller, $c, @args )
119
120Execute this action's coderef against a given controller with a given
121context and arguments
122
123=head2 match( $c )
124
125Check Args attribute, and makes sure number of args matches the setting.
126Always returns true if Args is omitted.
127
128=head2 compare
129
130Compares 2 actions based on the value of the C<Args> attribute, with no C<Args>
131having the highest precedence.
132
133=head2 namespace
134
135Returns the private namespace this action lives in.
136
137=head2 reverse
138
139Returns the private path for this action.
140
141=head2 private_path
142
143Returns absolute private path for this action. Unlike C<reverse>, the
144C<private_path> of an action is always suitable for passing to C<forward>.
145
146=head2 name
147
148Returns the sub name of this action.
149
150=head2 meta
151
152Provided by Moose.
153
154=head1 AUTHORS
155
156Catalyst Contributors, see Catalyst.pm
157
158=head1 COPYRIGHT
159
160This library is free software. You can redistribute it and/or modify it under
161the same terms as Perl itself.
162
163=cut