← 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:36:06 2011

File /usr/lib/perl5/vendor_perl/5.10.1/Epoll/View/Mail.pm
Statements Executed 63
Statement Execution Time 2.93ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
311855µs1.77sEpoll::View::Mail::::renderEpoll::View::Mail::render
111140µs154µsEpoll::View::Mail::::BEGIN@6Epoll::View::Mail::BEGIN@6
11178µs339µsEpoll::View::Mail::::BEGIN@4Epoll::View::Mail::BEGIN@4
11151µs65µsEpoll::View::Mail::::BEGIN@3Epoll::View::Mail::BEGIN@3
11140µs114µsEpoll::View::Mail::::BEGIN@7Epoll::View::Mail::BEGIN@7
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Epoll::View::Mail;
2
3391µs279µs
# spent 65µs (51+14) within Epoll::View::Mail::BEGIN@3 which was called # once (51µs+14µs) by Catalyst::Utils::ensure_class_loaded at line 3
use strict;
# spent 65µs making 1 call to Epoll::View::Mail::BEGIN@3 # spent 14µs making 1 call to strict::import
43141µs2601µs
# spent 339µs (78+261) within Epoll::View::Mail::BEGIN@4 which was called # once (78µs+261µs) by Catalyst::Utils::ensure_class_loaded at line 4
use base 'Catalyst::View::TT';
# spent 339µs making 1 call to Epoll::View::Mail::BEGIN@4 # spent 261µs making 1 call to base::import
53377µs230.5msuse Mail::Mailer;
# spent 30.5ms making 1 call to Epoll::View::Mail::BEGIN@5 # spent 9µs making 1 call to Mail::Mailer::import
63194µs2169µs
# spent 154µs (140+14) within Epoll::View::Mail::BEGIN@6 which was called # once (140µs+14µs) by Catalyst::Utils::ensure_class_loaded at line 6
use Epoll;
# spent 154µs making 1 call to Epoll::View::Mail::BEGIN@6 # spent 14µs making 1 call to Catalyst::import
731.15ms2188µs
# spent 114µs (40+74) within Epoll::View::Mail::BEGIN@7 which was called # once (40µs+74µs) by Catalyst::Utils::ensure_class_loaded at line 7
use Epoll::DB;
# spent 114µs making 1 call to Epoll::View::Mail::BEGIN@7 # spent 74µs making 1 call to Exporter::import
8
91116µs27.07ms__PACKAGE__->config(
# spent 5.50ms making 1 call to Catalyst::Component::config # spent 1.57ms making 1 call to Catalyst::path_to
10 TEMPLATE_EXTENSION => '.tt',
11 INCLUDE_PATH => Epoll->path_to( 'root', 'mail' ),
12 PLUGIN_BASE => 'Epoll::Template::Plugin',
13 PRE_PROCESS => [ 'includes/loc.tt', ],
14);
15
16=head1 NAME
17
18Epoll::View::TT - TT View for Epoll
19
20=head1 DESCRIPTION
21
22TT View for Epoll.
23
24=cut
25
26
# spent 1.77s (855µs+1.77) within Epoll::View::Mail::render which was called 3 times, avg 589ms/call: # 3 times (855µs+1.77s) by Catalyst::Action::execute at line 65 of Catalyst/Action.pm, avg 589ms/call
sub render {
2745808µs my ($self, $c, $template, $args) = @_;
28
29 # Backup locale, change it for mail
30 my $prev_language = $c->languages;
# spent 7.83ms making 3 calls to Catalyst::Plugin::I18N::languages, avg 2.61ms/call
31 $c->languages([ $c->req->param('mail_locale') ])
# spent 6.03ms making 3 calls to Catalyst::Plugin::I18N::languages, avg 2.01ms/call # spent 3.15ms making 6 calls to Catalyst::Request::param, avg 524µs/call # spent 122µs making 6 calls to Catalyst::req, avg 20µs/call
32 if($c->req->param('mail_locale'));
33
34 $ENV{MAILADDRESS} = $args->{From};
35 my $mailer = new Mail::Mailer 'smtp', Server => (Epoll->config->{smtp} || '127.0.0.1');
# spent 53.4ms making 3 calls to Mail::Mailer::new, avg 17.8ms/call # spent 3.04ms making 3 calls to Catalyst::config, avg 1.01ms/call
36 eval {
37 $mailer->open({
38 (map { $_ => $args->{$_} } grep { $_ !~ /^(mail)$/ } keys %{ $args || {}}),
# spent 825ms making 3 calls to Mail::Mailer::open, avg 275ms/call # spent 31µs making 12 calls to Epoll::View::Mail::CORE:match, avg 3µs/call
39 'Content-Type' => 'text/plain; charset=UTF-8; format=flowed',
40 'Content-Transfer-Encoding' => '8bit',
41 'X-Epoll-version' => $Epoll::DB::VERSION,
42 });
43 print $mailer
44141µs9424ms Catalyst::View::TT::render($self, $c, $template, { %{ $args->{mail} || {} }, c => $c });
# spent 420ms making 3 calls to Catalyst::View::TT::render, avg 140ms/call # spent 2.10ms making 3 calls to Epoll::View::Mail::CORE:print, avg 699µs/call # spent 2.05ms making 3 calls to Mail::Mailer::smtp::pipe::PRINT, avg 684µs/call
45 $mailer->close;
# spent 438ms making 3 calls to Mail::Mailer::smtp::close, avg 146ms/call
46 };
47 if ($@) {
48 $c->stash->{mail_error} = $@;
49 }
50 # restore locale
51 $c->languages($prev_language);
# spent 8.09ms making 3 calls to Catalyst::Plugin::I18N::languages, avg 2.70ms/call
52}
53
54=head1 SEE ALSO
55
56L<Epoll>
57
58=head1 AUTHOR
59
60Thauvin Olivier
61
62=head1 LICENSE
63
64This library is free software, you can redistribute it and/or modify
65it under the same terms as Perl itself or CeCILL.
66
67=cut
68
69119µs1;