← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 05.Domain_and_Item.t
  Run on Tue May 4 17:21:41 2010
Reported on Tue May 4 17:22:31 2010

File /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Params/ValidateXS.pm
Statements Executed 38
Statement Execution Time 748µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
6107623.4ms25.2msParams::Validate::::_validateParams::Validate::_validate (xsub)
5044310.4ms10.4msParams::Validate::::_validate_posParams::Validate::_validate_pos (xsub)
101199µs166µsParams::Validate::::_check_regex_from_xsParams::Validate::_check_regex_from_xs
101241µs41µsParams::Validate::::CORE:matchParams::Validate::CORE:match (opcode)
22237µs45µsParams::Validate::::BEGIN@3Params::Validate::BEGIN@3
101227µs27µsParams::Validate::::CORE:regcompParams::Validate::CORE:regcomp (opcode)
11118µs18µsParams::Validate::::BEGIN@41Params::Validate::BEGIN@41
11112µs12µsParams::Validate::::validation_optionsParams::Validate::validation_options
1119µs24µsParams::Validate::::BEGIN@4Params::Validate::BEGIN@4
0000s0sParams::Validate::::__ANON__[:11]Params::Validate::__ANON__[:11]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Params::Validate;
2
3322µs227µs
# spent 45µs (37+8) within Params::Validate::BEGIN@3 which was called 2 times, avg 22µs/call: # once (21µs+3µs) by Params::Validate::BEGIN@5 at line 3 # once (16µs+5µs) by SimpleDB::Class::Cache::BEGIN@33 at line 3 of Params/Validate.pm
use strict;
# spent 24µs making 1 call to Params::Validate::BEGIN@3 # spent 3µs making 1 call to strict::import
43239µs238µs
# spent 24µs (9+15) within Params::Validate::BEGIN@4 which was called # once (9µs+15µs) by Params::Validate::BEGIN@5 at line 4
use warnings;
# spent 24µs making 1 call to Params::Validate::BEGIN@4 # spent 15µs making 1 call to warnings::import
5
61600nsrequire XSLoader;
71239µs1234µsXSLoader::load( 'Params::Validate', $Params::Validate::VERSION );
# spent 234µs making 1 call to XSLoader::load
8
9
10my $default_fail = sub { require Carp;
1112µs Carp::confess($_[0]) };
12
13{
1435µs my %defaults = ( ignore_case => 0,
15 strip_leading => 0,
16 allow_extra => 0,
17 on_fail => $default_fail,
18 stack_skip => 1,
19 normalize_keys => undef,
20 );
21
22 *set_options = \&validation_options;
23 sub validation_options
24
# spent 12µs within Params::Validate::validation_options which was called # once (12µs+0s) by SimpleDB::Class::BEGIN@139 at line 38 of ../lib/SimpleDB/Class/Cache.pm
{
25410µs my %opts = @_;
26
27 my $caller = caller;
28
29 foreach ( keys %defaults )
30 {
3163µs $opts{$_} = $defaults{$_} unless exists $opts{$_};
32 }
33
34 $OPTIONS{$caller} = \%opts;
35 }
36}
37
3810171µs2067µs
# spent 166µs (99+67) within Params::Validate::_check_regex_from_xs which was called 10 times, avg 17µs/call: # 10 times (99µs+67µs) by Params::Validate::_validate at line 456 of DateTime.pm, avg 17µs/call
sub _check_regex_from_xs { return ( defined $_[0] ? $_[0] : '' ) =~ /$_[1]/ ? 1 : 0 }
# spent 41µs making 10 calls to Params::Validate::CORE:match, avg 4µs/call # spent 27µs making 10 calls to Params::Validate::CORE:regcomp, avg 3µs/call
39
40BEGIN
41
# spent 18µs within Params::Validate::BEGIN@41 which was called # once (18µs+0s) by Params::Validate::BEGIN@5 at line 135
{
42419µs if ( $] >= 5.006 && $] < 5.007 )
43 {
44 eval <<'EOF';
45sub check_for_error
46{
47 if ( defined $Params::Validate::ERROR )
48 {
49 $Params::Validate::ON_FAIL ||= sub { require Carp; Carp::croak( $_[0] ) };
50
51 $Params::Validate::ON_FAIL->($Params::Validate::ERROR)
52 }
53}
54
55sub validate_pos (\@@)
56{
57 local $Params::Validate::ERROR;
58 local $Params::Validate::ON_FAIL;
59 local $Params::Validate::CALLER = caller;
60
61 my $r;
62 if (defined wantarray)
63 {
64 $r = &_validate_pos;
65 }
66 else
67 {
68 &_validate_pos;
69 }
70
71 check_for_error();
72
73 return wantarray ? @$r : $r if defined wantarray;
74}
75
76sub validate (\@$)
77{
78 local $Params::Validate::ERROR;
79 local $Params::Validate::ON_FAIL;
80 local $Params::Validate::CALLER = caller;
81
82 my $r;
83 if (defined wantarray)
84 {
85 $r = &_validate;
86 }
87 else
88 {
89 &_validate;
90 }
91
92 check_for_error();
93
94 return wantarray ? %$r : $r if defined wantarray;
95}
96
97sub validate_with
98{
99 local $Params::Validate::ERROR;
100 local $Params::Validate::ON_FAIL;
101 local $Params::Validate::CALLER = caller;
102
103 my $r;
104 if (defined wantarray)
105 {
106 $r = &_validate_with;
107 }
108 else
109 {
110 &_validate_with;
111 }
112
113 check_for_error();
114
115 my %p = @_;
116 if ( UNIVERSAL::isa( $p{spec}, 'ARRAY' ) )
117 {
118 return wantarray ? @$r : $r if defined wantarray;
119 }
120 else
121 {
122 return wantarray ? %$r : $r if defined wantarray;
123 }
124}
125EOF
126
127 die $@ if $@;
128 }
129 else
130 {
131 *validate = \&_validate;
132 *validate_pos = \&_validate_pos;
133 *validate_with = \&_validate_with;
134 }
135126µs118µs}
# spent 18µs making 1 call to Params::Validate::BEGIN@41
136
137110µs1;
138
139__END__
140
141=head1 NAME
142
143Params::ValidateXS - XS implementation of Params::Validate
144
145=head1 SYNOPSIS
146
147 See Params::Validate
148
149=head1 DESCRIPTION
150
151This is an XS implementation of Params::Validate. See the
152Params::Validate documentation for details.
153
154=head1 COPYRIGHT
155
156Copyright (c) 2004-2007 David Rolsky. All rights reserved. This
157program is free software; you can redistribute it and/or modify it
158under the same terms as Perl itself.
159
160=cut
# spent 41µs within Params::Validate::CORE:match which was called 10 times, avg 4µs/call: # 10 times (41µs+0s) by Params::Validate::_check_regex_from_xs at line 38 of Params/ValidateXS.pm, avg 4µs/call
sub Params::Validate::CORE:match; # xsub
# spent 27µs within Params::Validate::CORE:regcomp which was called 10 times, avg 3µs/call: # 10 times (27µs+0s) by Params::Validate::_check_regex_from_xs at line 38 of Params/ValidateXS.pm, avg 3µs/call
sub Params::Validate::CORE:regcomp; # xsub
# spent 25.2ms (23.4+1.77) within Params::Validate::_validate which was called 610 times, avg 41µs/call: # 466 times (16.7ms+0s) by DateTime::Locale::_register at line 46 of DateTime/Locale.pm, avg 36µs/call # 63 times (1.75ms+0s) by DateTime::TimeZone::new at line 34 of DateTime/TimeZone.pm, avg 28µs/call # 39 times (3.14ms+1.57ms) by DateTime::new at line 189 of DateTime.pm, avg 121µs/call # 17 times (773µs+28µs) by DateTime::from_object at line 501 of DateTime.pm, avg 47µs/call # 10 times (574µs+166µs) by DateTime::from_epoch at line 456 of DateTime.pm, avg 74µs/call # 10 times (254µs+0s) by DateTime::TimeZone::OffsetOnly::new at line 16 of DateTime/TimeZone/OffsetOnly.pm, avg 25µs/call # 5 times (268µs+0s) by DateTime::Format::Strptime::new at line 127 of DateTime/Format/Strptime.pm, avg 54µs/call
sub Params::Validate::_validate; # xsub
# spent 10.4ms within Params::Validate::_validate_pos which was called 504 times, avg 21µs/call: # 423 times (7.21ms+0s) by DateTime::Locale::_registered_id at line 96 of DateTime/Locale.pm, avg 17µs/call # 40 times (1.16ms+0s) by DateTime::Locale::load at line 187 of DateTime/Locale.pm, avg 29µs/call # 24 times (1.36ms+0s) by SimpleDB::Class::Cache::get at line 254 of ../lib/SimpleDB/Class/Cache.pm, avg 57µs/call # 17 times (714µs+0s) by SimpleDB::Class::Cache::set at line 379 of ../lib/SimpleDB/Class/Cache.pm, avg 42µs/call
sub Params::Validate::_validate_pos; # xsub