← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:34 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Data/OptList.pm
StatementsExecuted 4813 statements in 5.64ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1113.99ms6.98msData::OptList::::BEGIN@10Data::OptList::BEGIN@10
155543.45ms4.47msData::OptList::::mkoptData::OptList::mkopt
1111.08ms1.34msData::OptList::::BEGIN@11Data::OptList::BEGIN@11
12021476µs738µsData::OptList::::__is_aData::OptList::__is_a (recurses: max depth 1, inclusive time 308µs)
24111249µs249µsData::OptList::::__ANON__[:54]Data::OptList::__ANON__[:54]
3021237µs1.93msData::OptList::::mkopt_hashData::OptList::mkopt_hash
11111µs24µsClass::Load::::BEGIN@2 Class::Load::BEGIN@2
11110µs13µsClass::Load::::BEGIN@1 Class::Load::BEGIN@1
1118µs19µsData::OptList::::BEGIN@100Data::OptList::BEGIN@100
1118µs8µsData::OptList::::BEGIN@15Data::OptList::BEGIN@15
1113µs3µsData::OptList::::BEGIN@9Data::OptList::BEGIN@9
1113µs3µsData::OptList::::BEGIN@4Data::OptList::BEGIN@4
0000s0sData::OptList::::__ANON__[:27]Data::OptList::__ANON__[:27]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1320µs216µs
# spent 13µs (10+3) within Class::Load::BEGIN@1 which was called: # once (10µs+3µs) by Class::Load::BEGIN@8 at line 1
use strict;
# spent 13µs making 1 call to Class::Load::BEGIN@1 # spent 3µs making 1 call to strict::import
2329µs237µs
# spent 24µs (11+13) within Class::Load::BEGIN@2 which was called: # once (11µs+13µs) by Class::Load::BEGIN@8 at line 2
use warnings;
# spent 24µs making 1 call to Class::Load::BEGIN@2 # spent 13µs making 1 call to warnings::import
3package Data::OptList;
4
# spent 3µs within Data::OptList::BEGIN@4 which was called: # once (3µs+0s) by Class::Load::BEGIN@8 at line 6
BEGIN {
517µs $Data::OptList::VERSION = '0.107';
6112µs13µs}
# spent 3µs making 1 call to Data::OptList::BEGIN@4
7# ABSTRACT: parse and validate simple name/value option pairs
8
9317µs13µs
# spent 3µs within Data::OptList::BEGIN@9 which was called: # once (3µs+0s) by Class::Load::BEGIN@8 at line 9
use List::Util ();
# spent 3µs making 1 call to Data::OptList::BEGIN@9
103101µs16.98ms
# spent 6.98ms (3.99+2.99) within Data::OptList::BEGIN@10 which was called: # once (3.99ms+2.99ms) by Class::Load::BEGIN@8 at line 10
use Params::Util ();
# spent 6.98ms making 1 call to Data::OptList::BEGIN@10
113153µs21.36ms
# spent 1.34ms (1.08+261µs) within Data::OptList::BEGIN@11 which was called: # once (1.08ms+261µs) by Class::Load::BEGIN@8 at line 11
use Sub::Install 0.921 ();
# spent 1.34ms making 1 call to Data::OptList::BEGIN@11 # spent 21µs making 1 call to UNIVERSAL::VERSION
12
13
141200nsmy %test_for;
15
# spent 8µs within Data::OptList::BEGIN@15 which was called: # once (8µs+0s) by Class::Load::BEGIN@8 at line 22
BEGIN {
1618µs %test_for = (
17 CODE => \&Params::Util::_CODELIKE, ## no critic
18 HASH => \&Params::Util::_HASHLIKE, ## no critic
19 ARRAY => \&Params::Util::_ARRAYLIKE, ## no critic
20 SCALAR => \&Params::Util::_SCALAR0, ## no critic
21 );
221350µs18µs}
# spent 8µs making 1 call to Data::OptList::BEGIN@15
23
24
# spent 738µs (476+262) within Data::OptList::__is_a which was called 120 times, avg 6µs/call: # 64 times (245µs+-245µs) by List::Util::first at line 27, avg 0s/call # 56 times (231µs+507µs) by Data::OptList::mkopt at line 77, avg 13µs/call
sub __is_a {
25304525µs my ($got, $expected) = @_;
26
2764236µs120507µs return List::Util::first { __is_a($got, $_) } @$expected if ref $expected;
# spent 507µs making 56 calls to List::Util::first, avg 9µs/call # spent 308µs making 64 calls to Data::OptList::__is_a, avg 5µs/call, recursion: max depth 1, sum of overlapping time 308µs
28
29 return defined (
306463µs exists($test_for{$expected})
# spent 39µs making 48 calls to Params::Util::_CODELIKE, avg 821ns/call # spent 12µs making 8 calls to Params::Util::_HASHLIKE, avg 1µs/call # spent 11µs making 8 calls to Params::Util::_ARRAYLIKE, avg 1µs/call
31 ? $test_for{$expected}->($got)
32 : Params::Util::_INSTANCE($got, $expected) ## no critic
33 );
34}
35
36
# spent 4.47ms (3.45+1.02) within Data::OptList::mkopt which was called 155 times, avg 29µs/call: # 63 times (826µs+0s) by Moose::Meta::Class::superclasses at line 551 of Moose/Meta/Class.pm, avg 13µs/call # 35 times (1.17ms+180µs) by Sub::Exporter::_expand_group at line 505 of Sub/Exporter.pm, avg 39µs/call # 34 times (469µs+10µs) by Sub::Exporter::__ANON__[/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Sub/Exporter.pm:756] at line 735 of Sub/Exporter.pm, avg 14µs/call # 19 times (870µs+822µs) by Data::OptList::mkopt_hash at line 94, avg 89µs/call # 4 times (108µs+11µs) by Moose::Util::_apply_all_roles at line 122 of Moose/Util.pm, avg 30µs/call
sub mkopt {
3740673.46ms my ($opt_list) = shift;
38
39 my ($moniker, $require_unique, $must_be); # the old positional args
40 my $name_test;
41
423934µs if (@_ == 1 and Params::Util::_HASHLIKE($_[0])) {
# spent 34µs making 39 calls to Params::Util::_HASHLIKE, avg 877ns/call
43 my $arg = $_[0];
44 ($moniker, $require_unique, $must_be, $name_test)
45 = @$arg{ qw(moniker require_unique must_be name_test) };
46 } else {
47 ($moniker, $require_unique, $must_be) = @_;
48 }
49
50 $moniker = 'unnamed' unless defined $moniker;
51
52 return [] unless $opt_list;
53
54241468µs
# spent 249µs within Data::OptList::__ANON__[/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Data/OptList.pm:54] which was called 241 times, avg 1µs/call: # 241 times (249µs+0s) by Data::OptList::mkopt at line 71, avg 1µs/call
$name_test ||= sub { ! ref $_[0] };
55
56 $opt_list = [
57 map { $_ => (ref $opt_list->{$_} ? $opt_list->{$_} : ()) } keys %$opt_list
58 ] if ref $opt_list eq 'HASH';
59
60 my @return;
61 my %seen;
62
63 for (my $i = 0; $i < @$opt_list; $i++) { ## no critic
64 my $name = $opt_list->[$i];
65 my $value;
66
67 if ($require_unique) {
68 Carp::croak "multiple definitions provided for $name" if $seen{$name}++;
69 }
70
71241249µs if ($i == $#$opt_list) { $value = undef; }
# spent 249µs making 241 calls to Data::OptList::__ANON__[Data/OptList.pm:54], avg 1µs/call
72 elsif (not defined $opt_list->[$i+1]) { $value = undef; $i++ }
73 elsif ($name_test->($opt_list->[$i+1])) { $value = undef; }
74 else { $value = $opt_list->[++$i] }
75
76 if ($must_be and defined $value) {
7756738µs unless (__is_a($value, $must_be)) {
# spent 738µs making 56 calls to Data::OptList::__is_a, avg 13µs/call
78 my $ref = ref $value;
79 Carp::croak "$ref-ref values are not valid in $moniker opt list";
80 }
81 }
82
83 push @return, [ $name => $value ];
84 }
85
86 return \@return;
87}
88
89
90
# spent 1.93ms (237µs+1.69) within Data::OptList::mkopt_hash which was called 30 times, avg 64µs/call: # 20 times (184µs+1.33ms) by Sub::Exporter::_rewrite_build_config at line 672 of Sub/Exporter.pm, avg 76µs/call # 10 times (53µs+362µs) by Sub::Exporter::_rewrite_build_config at line 685 of Sub/Exporter.pm, avg 42µs/call
sub mkopt_hash {
91117238µs my ($opt_list, $moniker, $must_be) = @_;
92 return {} unless $opt_list;
93
94191.69ms $opt_list = mkopt($opt_list, $moniker, 1, $must_be);
# spent 1.69ms making 19 calls to Data::OptList::mkopt, avg 89µs/call
95 my %hash = map { $_->[0] => $_->[1] } @$opt_list;
96 return \%hash;
97}
98
99
100
# spent 19µs (8+12) within Data::OptList::BEGIN@100 which was called: # once (8µs+12µs) by Class::Load::BEGIN@8 at line 104
BEGIN {
10118µs112µs *import = Sub::Install::exporter {
# spent 12µs making 1 call to Sub::Install::exporter
102 exports => [qw(mkopt mkopt_hash)],
103 };
104114µs119µs}
# spent 19µs making 1 call to Data::OptList::BEGIN@100
105
10612µs1;
107
108__END__