← 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:22 2010

File /data/SimpleDB-Class/author.t/../lib/SimpleDB/Class/Types.pm
Statements Executed 1088
Statement Execution Time 5.07ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.01ms28.6msSimpleDB::Class::Types::::BEGIN@77SimpleDB::Class::Types::BEGIN@77
57111973µs973µsSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:89]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:89]
111304µs6.01msSimpleDB::Class::Types::::BEGIN@83SimpleDB::Class::Types::BEGIN@83
7411303µs391µsSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:108]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:108]
12652236µs7.06msSimpleDB::Class::Types::::CORE:matchSimpleDB::Class::Types::CORE:match (opcode)
1621189µs189µsSimpleDB::Class::Types::::slice_stringSimpleDB::Class::Types::slice_string
7111142µs142µsSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:93]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:93]
2811124µs155µsSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:112]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:112]
711101µs152µsSimpleDB::Class::Types::::mend_stringSimpleDB::Class::Types::mend_string
141176µs76µsSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:159]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:159]
81172µs544µsSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:165]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:165]
91169µs6.95msSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:205]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:205]
51151µs1.25msSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:221]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:221]
81145µs1.68msSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:152]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:152]
81142µs86µsSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:163]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:163]
51141µs28.2msSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:185]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:185]
201133µs33µsSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:155]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:155]
71132µs184µsSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:170]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:170]
11131µs41µsSimpleDB::Class::Types::::BEGIN@70SimpleDB::Class::Types::BEGIN@70
51126µs28.8msSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:186]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:186]
51123µs648µsSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:206]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:206]
11110µs40µsSimpleDB::Class::Types::::BEGIN@73SimpleDB::Class::Types::BEGIN@73
71210µs10µsSimpleDB::Class::Types::::CORE:sortSimpleDB::Class::Types::CORE:sort (opcode)
1118µs142µsSimpleDB::Class::Types::::BEGIN@74SimpleDB::Class::Types::BEGIN@74
1117µs10µsSimpleDB::Class::Types::::BEGIN@71SimpleDB::Class::Types::BEGIN@71
1116µs6µsSimpleDB::Class::Types::::BEGIN@72SimpleDB::Class::Types::BEGIN@72
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:153]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:153]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:154]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:154]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:156]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:156]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:162]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:162]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:164]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:164]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:166]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:166]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:169]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:169]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:171]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:171]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:174]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:174]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:175]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:175]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:187]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:187]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:188]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:188]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:191]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:191]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:192]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:192]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:195]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:195]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:207]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:207]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:208]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:208]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:211]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:211]
0000s0sSimpleDB::Class::Types::::__ANON__[../lib/SimpleDB/Class/Types.pm:222]SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:222]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package SimpleDB::Class::Types;
2
3=head1 NAME
4
5SimpleDB::Class::Types - Attribute types.
6
7=head1 DESCRIPTION
8
9The allowable value types for L<SimpleDB::Class::Item> attributes.
10
11=head1 SYNOPSIS
12
13 Type | Default | Range
14 -----------------------+----------------+-----------------------------------------------
15 Str | '' | 0 to 1024 characters
16 MediumStr | '' | 0 to 259,080 chracters
17 ArrayRefOfStr | [] | 254 Str elements
18 Int | 0 | -999,999,999 to 99,999,999,999,999 (no commas)
19 ArrayRefOfInt | [] | 254 Int elements
20 DateTime | now() | Any DateTime object
21 ArrayRefOfDateTime | [] | 254 DateTime elements
22 HashRef | {} | Less than 259,080 characters when converted to JSON
23
24=head1 TYPES
25
26The following types may be used to define attributes in L<SimpleDB::Class::Item>s.
27
28=head2 Str
29
30A string of less than 1024 characters. Defaults to C<''>. The basic working unit of SimpleDB. This is the fastest type as it needs no coercion, and is the native storage unit for SimpleDB. When in dobut, use this.
31
32=head2 ArrayRefOfStr
33
34An array reference of strings which can have up to 254 elements. Each string follows the rules of C<Str>. This is your basic multi-value workhorse, as it is the fastest multi-value type. See B<Attribute Limits> for special considerations about this type.
35
36=head2 MediumStr
37
38A string of up to 259,080 characters. Defaults to C<''>. Use this B<only> if you need to store text larger than C<Str> will allow. Much slower than C<Str> and not reliably searchable or sortable. See B<Attribute Limits> for special considerations about this type.
39
40=head2 Int
41
42An integer between -999,999,999 and 99,999,999,999,999 (without the commas). Defaults to C<0>. Is completely searchable and sortable.
43
44=head2 ArrayRefOfInt
45
46An array reference of integers which can have up to 254 elements. Each integer follows the rules of C<Int>. If you need a multi-value integer type, this is the way to go. See B<Attribute Limits> for special considerations about this type.
47
48=head2 DateTime
49
50A L<DateTime> object. Defaults to:
51
52 DateTime->now();
53
54Store a precise date in the database. Is searchable and sortable.
55
56=head2 ArrayRefOfDateTime
57
58An array reference of dates which can have up to 254 elements. Each date follows the rules of C<DateTime>. Use this if you need a multi-value date. See B<Attribute Limits> for special considerations about this type.
59
60=head2 HashRef
61
62A hash reference. For storage this is serialized into JSON and stored as a C<MediumStr>, therefore it cannot exceed 259,080 characters after serialization. You B<cannot> use it to store a blessed hash reference. It is not searchable, not sortable, and is the slowest field type available. However, it can be quite useful if you need to persist a hash reference. See B<Attribute Limits> for special considerations about this type.
63
64=head1 Attribute Limits
65
66SimpleDB Items are limited to 256 attributes each. This means that they can have no more than any combination of names, values, or multi values. So you can have 256 name/value pairs, or you could have one multi-valued attribute with 256 elements, or anything in between. For that reason, be careful when adding ArrayRefOfDateTime, ArrayRefOfInt, ArrayRefOfStr, MediumStr, and HashRef elements to your items.
67
68=cut
69
70325µs251µs
# spent 41µs (31+10) within SimpleDB::Class::Types::BEGIN@70 which was called # once (31µs+10µs) by SimpleDB::Class::Role::Itemized::BEGIN@4 at line 70
use warnings;
# spent 41µs making 1 call to SimpleDB::Class::Types::BEGIN@70 # spent 10µs making 1 call to warnings::import
71319µs212µs
# spent 10µs (7+2) within SimpleDB::Class::Types::BEGIN@71 which was called # once (7µs+2µs) by SimpleDB::Class::Role::Itemized::BEGIN@4 at line 71
use strict;
# spent 10µs making 1 call to SimpleDB::Class::Types::BEGIN@71 # spent 2µs making 1 call to strict::import
72330µs16µs
# spent 6µs within SimpleDB::Class::Types::BEGIN@72 which was called # once (6µs+0s) by SimpleDB::Class::Role::Itemized::BEGIN@4 at line 72
use DateTime;
# spent 6µs making 1 call to SimpleDB::Class::Types::BEGIN@72
73324µs269µs
# spent 40µs (10+29) within SimpleDB::Class::Types::BEGIN@73 which was called # once (10µs+29µs) by SimpleDB::Class::Role::Itemized::BEGIN@4 at line 73
use DateTime::Format::Strptime;
# spent 40µs making 1 call to SimpleDB::Class::Types::BEGIN@73 # spent 29µs making 1 call to Exporter::import
74336µs2276µs
# spent 142µs (8+134) within SimpleDB::Class::Types::BEGIN@74 which was called # once (8µs+134µs) by SimpleDB::Class::Role::Itemized::BEGIN@4 at line 74
use JSON;
# spent 142µs making 1 call to SimpleDB::Class::Types::BEGIN@74 # spent 134µs making 1 call to JSON::import
75
76use MooseX::Types
77
# spent 28.6ms (1.01+27.6) within SimpleDB::Class::Types::BEGIN@77 which was called # once (1.01ms+27.6ms) by SimpleDB::Class::Role::Itemized::BEGIN@4 at line 81
-declare => [qw(SdbArrayRefOfDateTime SdbDateTime
# spent 5.66ms making 1 call to MooseX::Types::import
78 SdbArrayRefOfStr SdbStr SdbMediumStr
79 SdbArrayRefOfInt SdbInt SdbIntAsStr SdbArrayRefOfIntAsStr
80 SdbHashRef
813151µs128.6ms )];
# spent 28.6ms making 1 call to SimpleDB::Class::Types::BEGIN@77
82
8331.24ms28.71ms
# spent 6.01ms (304µs+5.71) within SimpleDB::Class::Types::BEGIN@83 which was called # once (304µs+5.71ms) by SimpleDB::Class::Role::Itemized::BEGIN@4 at line 83
use MooseX::Types::Moose qw/Int HashRef ArrayRef Str Undef/;
# spent 6.01ms making 1 call to SimpleDB::Class::Types::BEGIN@83 # spent 2.70ms making 1 call to MooseX::Types::Base::import
84
85## Types
86
87subtype SdbStr,
88 as Str,
895721.38ms5652µs
# spent 973µs within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:89] which was called 571 times, avg 2µs/call: # 571 times (973µs+0s) by SimpleDB::Class::Types::SdbStr at line 252 of Moose/Meta/TypeConstraint.pm, avg 2µs/call
where { length $_ <= 1024 };
# spent 447µs making 1 call to MooseX::Types::CheckedUtilExports::subtype # spent 132µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbStr # spent 50µs making 1 call to __TYPE__::Str # spent 20µs making 1 call to MooseX::Types::CheckedUtilExports::as # spent 3µs making 1 call to Moose::Util::TypeConstraints::where
90
91subtype SdbMediumStr,
92 as Str,
9372208µs8376µs
# spent 142µs within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:93] which was called 71 times, avg 2µs/call: # 71 times (142µs+0s) by SimpleDB::Class::Types::SdbMediumStr at line 252 of Moose/Meta/TypeConstraint.pm, avg 2µs/call
where { length $_ <= 1020 * 254 };
# spent 264µs making 1 call to MooseX::Types::CheckedUtilExports::subtype # spent 50µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbMediumStr # spent 47µs making 1 call to __TYPE__::Str # spent 10µs making 1 call to MooseX::Types::CheckedUtilExports::as # spent 2µs making 2 calls to MooseX::Types::TypeDecorator::DESTROY, avg 950ns/call # spent 2µs making 1 call to Moose::Util::TypeConstraints::where # spent 1µs making 1 call to MooseX::Types::UndefinedType::DESTROY
94
95111µs81.41mssubtype SdbArrayRefOfStr,
# spent 944µs making 1 call to __TYPE__::ArrayRef # spent 370µs making 1 call to MooseX::Types::CheckedUtilExports::subtype # spent 48µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfStr # spent 40µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbStr # spent 11µs making 1 call to MooseX::Types::CheckedUtilExports::as # spent 1µs making 2 calls to MooseX::Types::TypeDecorator::DESTROY, avg 700ns/call # spent 600ns making 1 call to MooseX::Types::UndefinedType::DESTROY
96 as ArrayRef[SdbStr];
97
9815µs4257µsclass_type 'DateTime';
# spent 255µs making 1 call to MooseX::Types::CheckedUtilExports::class_type # spent 1µs making 2 calls to MooseX::Types::TypeDecorator::DESTROY, avg 650ns/call # spent 500ns making 1 call to MooseX::Types::UndefinedType::DESTROY
99
10017µs3441µssubtype SdbDateTime,
# spent 339µs making 1 call to MooseX::Types::CheckedUtilExports::subtype # spent 54µs making 1 call to MooseX::Types::CheckedUtilExports::as # spent 48µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbDateTime
101 as 'DateTime';
102
103111µs71.11mssubtype SdbArrayRefOfDateTime,
# spent 691µs making 1 call to __TYPE__::ArrayRef # spent 310µs making 1 call to MooseX::Types::CheckedUtilExports::subtype # spent 54µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfDateTime # spent 41µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbDateTime # spent 11µs making 1 call to MooseX::Types::CheckedUtilExports::as # spent 900ns making 1 call to MooseX::Types::TypeDecorator::DESTROY # spent 600ns making 1 call to MooseX::Types::UndefinedType::DESTROY
104 as ArrayRef[SdbDateTime];
105
106subtype SdbInt,
107 as Int,
10875437µs82496µs
# spent 391µs (303+87) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:108] which was called 74 times, avg 5µs/call: # 74 times (303µs+87µs) by SimpleDB::Class::Types::SdbInt at line 252 of Moose/Meta/TypeConstraint.pm, avg 5µs/call
where { $_ =~ m/^[-]?\d+$/ };
# spent 291µs making 1 call to MooseX::Types::CheckedUtilExports::subtype # spent 87µs making 74 calls to SimpleDB::Class::Types::CORE:match, avg 1µs/call # spent 54µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbInt # spent 48µs making 1 call to __TYPE__::Int # spent 12µs making 1 call to MooseX::Types::CheckedUtilExports::as # spent 2µs making 1 call to Moose::Util::TypeConstraints::where # spent 1µs making 2 calls to MooseX::Types::TypeDecorator::DESTROY, avg 700ns/call # spent 600ns making 1 call to MooseX::Types::UndefinedType::DESTROY
109
110subtype SdbIntAsStr,
111 as Str,
11229179µs36416µs
# spent 155µs (124+31) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:112] which was called 28 times, avg 6µs/call: # 28 times (124µs+31µs) by SimpleDB::Class::Types::SdbIntAsStr at line 252 of Moose/Meta/TypeConstraint.pm, avg 6µs/call
where { $_ =~ m/^int\d{15}/ };
# spent 274µs making 1 call to MooseX::Types::CheckedUtilExports::subtype # spent 53µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbIntAsStr # spent 44µs making 1 call to __TYPE__::Str # spent 31µs making 28 calls to SimpleDB::Class::Types::CORE:match, avg 1µs/call # spent 11µs making 1 call to MooseX::Types::CheckedUtilExports::as # spent 2µs making 1 call to Moose::Util::TypeConstraints::where # spent 2µs making 2 calls to MooseX::Types::TypeDecorator::DESTROY, avg 750ns/call # spent 600ns making 1 call to MooseX::Types::UndefinedType::DESTROY
113
114112µs81.08mssubtype SdbArrayRefOfInt,
# spent 686µs making 1 call to __TYPE__::ArrayRef # spent 291µs making 1 call to MooseX::Types::CheckedUtilExports::subtype # spent 48µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfInt # spent 42µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbInt # spent 11µs making 1 call to MooseX::Types::CheckedUtilExports::as # spent 1µs making 2 calls to MooseX::Types::TypeDecorator::DESTROY, avg 600ns/call # spent 600ns making 1 call to MooseX::Types::UndefinedType::DESTROY
115 as ArrayRef[SdbInt];
116
117112µs81.07mssubtype SdbArrayRefOfIntAsStr,
# spent 690µs making 1 call to __TYPE__::ArrayRef # spent 277µs making 1 call to MooseX::Types::CheckedUtilExports::subtype # spent 50µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfIntAsStr # spent 40µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbIntAsStr # spent 11µs making 1 call to MooseX::Types::CheckedUtilExports::as # spent 1µs making 2 calls to MooseX::Types::TypeDecorator::DESTROY, avg 600ns/call # spent 500ns making 1 call to MooseX::Types::UndefinedType::DESTROY
118 as ArrayRef[SdbIntAsStr];
119
120117µs7389µssubtype SdbHashRef,
# spent 275µs making 1 call to MooseX::Types::CheckedUtilExports::subtype # spent 52µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbHashRef # spent 46µs making 1 call to __TYPE__::HashRef # spent 11µs making 1 call to MooseX::Types::CheckedUtilExports::as # spent 4µs making 1 call to MooseX::Types::UndefinedType::DESTROY # spent 1µs making 2 calls to MooseX::Types::TypeDecorator::DESTROY, avg 650ns/call
121 as HashRef;
122
123
124
125
126## Coercions
127
128
# spent 189µs within SimpleDB::Class::Types::slice_string which was called 16 times, avg 12µs/call: # 8 times (145µs+0s) by SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:165] at line 165, avg 18µs/call # 8 times (44µs+0s) by SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:163] at line 163, avg 5µs/call
sub slice_string {
129138189µs my $string = shift;
130 my @array;
131 my $i = 1;
132 my @parts;
133 push @parts, substr $string, 0, 1020, '' while length $string;
134 foreach my $part (@parts) {
135 push @array, sprintf "%03d|%s", $i, $part;
136 $i++;
137 }
138 return \@array;
139}
140
141
# spent 152µs (101+51) within SimpleDB::Class::Types::mend_string which was called 7 times, avg 22µs/call: # 7 times (101µs+51µs) by SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:170] at line 170, avg 22µs/call
sub mend_string {
14248150µs my $array_ref = shift;
143 my $string;
144 foreach my $part (sort @{$array_ref}) {
# spent 10µs making 7 calls to SimpleDB::Class::Types::CORE:sort, avg 1µs/call
145 $part =~ m/^\d{3}\|(.*)/xms;
# spent 41µs making 10 calls to SimpleDB::Class::Types::CORE:match, avg 4µs/call
146 $string .= $1;
147 }
148 return $string;
149}
150
151coerce SdbStr,
152844µs81.64ms
# spent 1.68ms (45µs+1.64) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:152] which was called 8 times, avg 210µs/call: # 8 times (45µs+1.64ms) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 210µs/call
from SdbDateTime, via { DateTime::Format::Strptime::strftime('%Y-%m-%d %H:%M:%S %N %z', $_) },
# spent 1.64ms making 8 calls to DateTime::Format::Strptime::strftime, avg 205µs/call
153 from SdbArrayRefOfDateTime, via { $_->[0] },
154 from SdbMediumStr, via { substr(0,1024,$_) },
1552050µs
# spent 33µs within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:155] which was called 20 times, avg 2µs/call: # 20 times (33µs+0s) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 2µs/call
from SdbArrayRefOfStr, via { $_->[0] },
156136µs20955µs from Undef, via { '' };
# spent 647µs making 1 call to MooseX::Types::CheckedUtilExports::coerce # spent 58µs making 5 calls to MooseX::Types::CheckedUtilExports::from, avg 12µs/call # spent 43µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbStr # spent 40µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbMediumStr # spent 40µs making 1 call to __TYPE__::Undef # spent 40µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbDateTime # spent 40µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfDateTime # spent 38µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfStr # spent 6µs making 5 calls to Moose::Util::TypeConstraints::via, avg 1µs/call # spent 1µs making 2 calls to MooseX::Types::TypeDecorator::DESTROY, avg 700ns/call # spent 500ns making 1 call to MooseX::Types::UndefinedType::DESTROY
157
158coerce SdbIntAsStr,
1591593µs6365µs
# spent 76µs within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:159] which was called 14 times, avg 5µs/call: # 14 times (76µs+0s) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 5µs/call
from SdbInt, via { sprintf("int%015d", ($_ + 1000000000)) };
# spent 266µs making 1 call to MooseX::Types::CheckedUtilExports::coerce # spent 47µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbIntAsStr # spent 39µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbInt # spent 10µs making 1 call to MooseX::Types::CheckedUtilExports::from # spent 1µs making 1 call to Moose::Util::TypeConstraints::via # spent 800ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
160
161coerce SdbArrayRefOfStr,
162 from SdbArrayRefOfDateTime, via { [ map { to_SdbStr($_) } @{$_} ] },
163832µs844µs
# spent 86µs (42+44) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:163] which was called 8 times, avg 11µs/call: # 8 times (42µs+44µs) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 11µs/call
from SdbMediumStr, via { slice_string($_) },
# spent 44µs making 8 calls to SimpleDB::Class::Types::slice_string, avg 5µs/call
164 from SdbStr, via { [ $_ ] },
165993µs391.09ms
# spent 544µs (72+473) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:165] which was called 8 times, avg 68µs/call: # 8 times (72µs+473µs) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 68µs/call
from SdbHashRef, via { slice_string(JSON::to_json($_)) };
# spent 363µs making 1 call to MooseX::Types::CheckedUtilExports::coerce # spent 327µs making 8 calls to JSON::to_json, avg 41µs/call # spent 145µs making 8 calls to SimpleDB::Class::Types::slice_string, avg 18µs/call # spent 46µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfStr # spent 40µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfDateTime # spent 39µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbMediumStr # spent 38µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbHashRef # spent 38µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbStr # spent 32µs making 4 calls to MooseX::Types::CheckedUtilExports::from, avg 8µs/call # spent 13µs making 8 calls to JSON::XS::DESTROY, avg 2µs/call # spent 4µs making 4 calls to Moose::Util::TypeConstraints::via, avg 900ns/call # spent 800ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
16617µs456µs from Undef, via { [''] };
# spent 45µs making 1 call to __TYPE__::Undef # spent 9µs making 1 call to MooseX::Types::CheckedUtilExports::from # spent 1µs making 1 call to Moose::Util::TypeConstraints::via # spent 700ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
167
168coerce SdbMediumStr,
169 from SdbStr, via { $_ },
170732µs7152µs
# spent 184µs (32+152) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:170] which was called 7 times, avg 26µs/call: # 7 times (32µs+152µs) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 26µs/call
from SdbArrayRefOfStr, via { mend_string($_) },
# spent 152µs making 7 calls to SimpleDB::Class::Types::mend_string, avg 22µs/call
171120µs12554µs from Undef, via { '' };
# spent 310µs making 1 call to MooseX::Types::CheckedUtilExports::coerce # spent 63µs making 1 call to __TYPE__::Undef # spent 54µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfStr # spent 44µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbStr # spent 42µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbMediumStr # spent 38µs making 3 calls to MooseX::Types::CheckedUtilExports::from, avg 12µs/call # spent 4µs making 3 calls to Moose::Util::TypeConstraints::via, avg 1µs/call # spent 700ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
172
173coerce SdbArrayRefOfDateTime,
174 from SdbArrayRefOfStr, via { [ map { to_SdbDateTime($_) } @{$_} ] },
175112µs9430µs from SdbDateTime, via { [ $_ ] };
# spent 287µs making 1 call to MooseX::Types::CheckedUtilExports::coerce # spent 46µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfDateTime # spent 39µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfStr # spent 39µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbDateTime # spent 17µs making 2 calls to MooseX::Types::CheckedUtilExports::from, avg 8µs/call # spent 2µs making 2 calls to Moose::Util::TypeConstraints::via, avg 1µs/call # spent 700ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
176
177coerce SdbDateTime,
178
# spent 28.2ms (41µs+28.1) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:185] which was called 5 times, avg 5.63ms/call: # 5 times (41µs+28.1ms) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 5.63ms/call
from SdbStr, via {
1791067µs523µs if ($_ =~ m/\d{4}-\d\d-\d\d \d\d:\d\d:\d\d \d+ \+\d{4}/ ) {
# spent 23µs making 5 calls to SimpleDB::Class::Types::CORE:match, avg 5µs/call
180 return DateTime::Format::Strptime::strptime('%Y-%m-%d %H:%M:%S %N %z', $_);
# spent 28.1ms making 5 calls to DateTime::Format::Strptime::strptime, avg 5.62ms/call
181 }
182 else {
183 return DateTime->now;
184 }
185 },
186524µs528.7ms
# spent 28.8ms (26µs+28.7) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:186] which was called 5 times, avg 5.75ms/call: # 5 times (26µs+28.7ms) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 5.75ms/call
from SdbArrayRefOfStr, via { to_SdbDateTime($_->[0]) },
# spent 28.7ms making 5 calls to MooseX::Types::__ANON__[MooseX/Types.pm:486], avg 5.75ms/call
187 from SdbArrayRefOfDateTime, via { $_->[0] },
188127µs15564µs from Undef, via { DateTime->now };
# spent 326µs making 1 call to MooseX::Types::CheckedUtilExports::coerce # spent 45µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbDateTime # spent 40µs making 1 call to __TYPE__::Undef # spent 39µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfStr # spent 39µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbStr # spent 39µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfDateTime # spent 31µs making 4 calls to MooseX::Types::CheckedUtilExports::from, avg 8µs/call # spent 4µs making 4 calls to Moose::Util::TypeConstraints::via, avg 1µs/call # spent 600ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
189
190coerce SdbArrayRefOfInt,
191 from SdbArrayRefOfStr, via { [ map { to_SdbInt($_) } @{$_} ] },
192118µs9448µs from SdbInt, via { [ $_ ] };
# spent 295µs making 1 call to MooseX::Types::CheckedUtilExports::coerce # spent 46µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfInt # spent 40µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbInt # spent 39µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfStr # spent 25µs making 2 calls to MooseX::Types::CheckedUtilExports::from, avg 12µs/call # spent 2µs making 2 calls to Moose::Util::TypeConstraints::via, avg 1µs/call # spent 700ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
193
194coerce SdbArrayRefOfIntAsStr,
19519µs6390µs from SdbArrayRefOfInt, via { [ map { to_SdbIntAsStr($_) } @{$_} ] };
# spent 287µs making 1 call to MooseX::Types::CheckedUtilExports::coerce # spent 46µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfIntAsStr # spent 46µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfInt # spent 10µs making 1 call to MooseX::Types::CheckedUtilExports::from # spent 1µs making 1 call to Moose::Util::TypeConstraints::via # spent 700ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
196
197coerce SdbInt,
198
# spent 6.95ms (69µs+6.88) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:205] which was called 9 times, avg 772µs/call: # 9 times (69µs+6.88ms) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 772µs/call
from SdbStr, via {
1999129µs1013.7ms if ($_ =~ m/^int(\d{15})$/) {
# spent 6.88ms making 9 calls to SimpleDB::Class::Types::CORE:match, avg 765µs/call # spent 6.83ms making 1 call to utf8::SWASHNEW
200 return $1 - 1000000000;
201 }
202 else {
203 return 0;
204 }
205 },
206526µs5624µs
# spent 648µs (23+625) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:206] which was called 5 times, avg 130µs/call: # 5 times (23µs+625µs) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 130µs/call
from SdbArrayRefOfStr, via { to_SdbInt($_->[0]) },
# spent 624µs making 5 calls to MooseX::Types::__ANON__[MooseX/Types.pm:486], avg 125µs/call
207 from SdbArrayRefOfInt, via { $_->[0] },
208119µs15585µs from Undef, via { 0 };
# spent 341µs making 1 call to MooseX::Types::CheckedUtilExports::coerce # spent 45µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbInt # spent 41µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfStr # spent 39µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfInt # spent 39µs making 1 call to __TYPE__::Undef # spent 38µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbStr # spent 37µs making 4 calls to MooseX::Types::CheckedUtilExports::from, avg 9µs/call # spent 4µs making 4 calls to Moose::Util::TypeConstraints::via, avg 925ns/call # spent 700ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
209
210coerce SdbHashRef,
211 from Undef, via { {} },
212
# spent 1.25ms (51µs+1.20) within SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:221] which was called 5 times, avg 250µs/call: # 5 times (51µs+1.20ms) by Moose::Meta::TypeCoercion::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/TypeCoercion.pm:67] at line 63 of Moose/Meta/TypeCoercion.pm, avg 250µs/call
from SdbArrayRefOfStr, via {
2132048µs151.20ms my $hash_ref = eval{ JSON::from_json(to_SdbMediumStr($_)) };
# spent 1.02ms making 5 calls to MooseX::Types::__ANON__[MooseX/Types.pm:486], avg 203µs/call # spent 182µs making 5 calls to JSON::from_json, avg 36µs/call # spent 7µs making 5 calls to JSON::XS::DESTROY, avg 1µs/call
214 if ($@) {
215 warn "Got $@ coercing json into hash ref";
216 return {};
217 }
218 else {
219 return $hash_ref;
220 }
221 },
222117µs12522µs from SdbStr, via { {} };
# spent 318µs making 1 call to MooseX::Types::CheckedUtilExports::coerce # spent 50µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbStr # spent 46µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbHashRef # spent 41µs making 1 call to __TYPE__::Undef # spent 40µs making 1 call to __TYPE__::SimpleDB::Class::Types::SdbArrayRefOfStr # spent 24µs making 3 calls to MooseX::Types::CheckedUtilExports::from, avg 8µs/call # spent 3µs making 3 calls to Moose::Util::TypeConstraints::via, avg 967ns/call # spent 700ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
223
224
225=head1 LEGAL
226
227SimpleDB::Class is Copyright 2009-2010 Plain Black Corporation (L<http://www.plainblack.com/>) and is licensed under the same terms as Perl itself.
228
229=cut
230
231
2321120µs1700ns1;
# spent 700ns making 1 call to MooseX::Types::TypeDecorator::DESTROY
# spent 7.06ms (236µs+6.83) within SimpleDB::Class::Types::CORE:match which was called 126 times, avg 56µs/call: # 74 times (87µs+0s) by SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:108] at line 108 of ../lib/SimpleDB/Class/Types.pm, avg 1µs/call # 28 times (31µs+0s) by SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:112] at line 112 of ../lib/SimpleDB/Class/Types.pm, avg 1µs/call # 10 times (41µs+0s) by SimpleDB::Class::Types::mend_string at line 145 of ../lib/SimpleDB/Class/Types.pm, avg 4µs/call # 9 times (53µs+6.83ms) by SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:205] at line 199 of ../lib/SimpleDB/Class/Types.pm, avg 765µs/call # 5 times (23µs+0s) by SimpleDB::Class::Types::__ANON__[../lib/SimpleDB/Class/Types.pm:185] at line 179 of ../lib/SimpleDB/Class/Types.pm, avg 5µs/call
sub SimpleDB::Class::Types::CORE:match; # xsub
# spent 10µs within SimpleDB::Class::Types::CORE:sort which was called 7 times, avg 1µs/call: # 7 times (10µs+0s) by SimpleDB::Class::Types::mend_string at line 144 of ../lib/SimpleDB/Class/Types.pm, avg 1µs/call
sub SimpleDB::Class::Types::CORE:sort; # xsub