← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:49 2015

Filename/usr/share/perl5/DateTime/Format/Builder/Parser/Dispatch.pm
StatementsExecuted 19 statements in 495µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11114µs27µsDateTime::Format::Builder::Parser::Dispatch::::BEGIN@5DateTime::Format::Builder::Parser::Dispatch::BEGIN@5
1119µs17µsDateTime::Format::Builder::Parser::Dispatch::::BEGIN@6DateTime::Format::Builder::Parser::Dispatch::BEGIN@6
1119µs34µsDateTime::Format::Builder::Parser::Dispatch::::BEGIN@8DateTime::Format::Builder::Parser::Dispatch::BEGIN@8
1118µs28µsDateTime::Format::Builder::Parser::Dispatch::::BEGIN@7DateTime::Format::Builder::Parser::Dispatch::BEGIN@7
1117µs7µsDateTime::Format::Builder::Parser::Dispatch::::BEGIN@9DateTime::Format::Builder::Parser::Dispatch::BEGIN@9
1115µs13µsDateTime::Format::Builder::Parser::Dispatch::::BEGIN@14DateTime::Format::Builder::Parser::Dispatch::BEGIN@14
0000s0sDateTime::Format::Builder::Parser::Dispatch::::__ANON__[:45]DateTime::Format::Builder::Parser::Dispatch::__ANON__[:45]
0000s0sDateTime::Format::Builder::Parser::Dispatch::::create_parserDateTime::Format::Builder::Parser::Dispatch::create_parser
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package DateTime::Format::Builder::Parser::Dispatch;
2{
32800ns $DateTime::Format::Builder::Parser::Dispatch::VERSION = '0.81';
4}
5226µs241µs
# spent 27µs (14+14) within DateTime::Format::Builder::Parser::Dispatch::BEGIN@5 which was called: # once (14µs+14µs) by DateTime::Format::Builder::Parser::BEGIN@1 at line 5
use strict;
# spent 27µs making 1 call to DateTime::Format::Builder::Parser::Dispatch::BEGIN@5 # spent 14µs making 1 call to strict::import
62203µs224µs
# spent 17µs (9+7) within DateTime::Format::Builder::Parser::Dispatch::BEGIN@6 which was called: # once (9µs+7µs) by DateTime::Format::Builder::Parser::BEGIN@1 at line 6
use warnings;
# spent 17µs making 1 call to DateTime::Format::Builder::Parser::Dispatch::BEGIN@6 # spent 7µs making 1 call to warnings::import
7225µs247µs
# spent 28µs (8+19) within DateTime::Format::Builder::Parser::Dispatch::BEGIN@7 which was called: # once (8µs+19µs) by DateTime::Format::Builder::Parser::BEGIN@1 at line 7
use vars qw( %dispatch_data );
# spent 28µs making 1 call to DateTime::Format::Builder::Parser::Dispatch::BEGIN@7 # spent 19µs making 1 call to vars::import
8224µs259µs
# spent 34µs (9+25) within DateTime::Format::Builder::Parser::Dispatch::BEGIN@8 which was called: # once (9µs+25µs) by DateTime::Format::Builder::Parser::BEGIN@1 at line 8
use Params::Validate qw( CODEREF validate );
# spent 34µs making 1 call to DateTime::Format::Builder::Parser::Dispatch::BEGIN@8 # spent 25µs making 1 call to Exporter::import
9226µs17µs
# spent 7µs within DateTime::Format::Builder::Parser::Dispatch::BEGIN@9 which was called: # once (7µs+0s) by DateTime::Format::Builder::Parser::BEGIN@1 at line 9
use DateTime::Format::Builder::Parser;
10
- -
13{
143182µs221µs
# spent 13µs (5+8) within DateTime::Format::Builder::Parser::Dispatch::BEGIN@14 which was called: # once (5µs+8µs) by DateTime::Format::Builder::Parser::BEGIN@1 at line 14
no strict 'refs';
# spent 13µs making 1 call to DateTime::Format::Builder::Parser::Dispatch::BEGIN@14 # spent 8µs making 1 call to strict::unimport
1511µs *dispatch_data = *DateTime::Format::Builder::dispatch_data;
161700ns *params = *DateTime::Format::Builder::Parser::params;
17}
18
19DateTime::Format::Builder::Parser->valid_params(
2013µs18µs Dispatch => {
# spent 8µs making 1 call to DateTime::Format::Builder::Parser::valid_params
21 type => CODEREF,
22 }
23);
24
25sub create_parser {
26 my ( $self, %args ) = @_;
27 my $coderef = $args{Dispatch};
28
29 return sub {
30 my ( $self, $date, $p, @args ) = @_;
31 return unless defined $date;
32 my $class = ref($self) || $self;
33
34 my @results = $coderef->($date);
35 return unless @results;
36 return unless defined $results[0];
37
38 for my $group (@results) {
39 my $parser = $dispatch_data{$class}{$group};
40 die "Unknown parsing group: $class\n" unless defined $parser;
41 my $rv = eval { $parser->parse( $self, $date, $p, @args ) };
42 return $rv unless $@ or not defined $rv;
43 }
44 return;
45 };
46}
47
4813µs1;
49
50# ABSTRACT: Dispatch parsers by group
51
52__END__