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

File /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Util/TypeConstraints/OptimizedConstraints.pm
Statements Executed 2019
Statement Execution Time 4.99ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
776641.57ms1.57msMoose::Util::TypeConstraints::OptimizedConstraints::::StrMoose::Util::TypeConstraints::OptimizedConstraints::Str
14454629µs4.34msMoose::Util::TypeConstraints::OptimizedConstraints::::IntMoose::Util::TypeConstraints::OptimizedConstraints::Int
13912436µs3.71msMoose::Util::TypeConstraints::OptimizedConstraints::::CORE:matchMoose::Util::TypeConstraints::OptimizedConstraints::CORE:match (opcode)
18611259µs259µsMoose::Util::TypeConstraints::OptimizedConstraints::::ArrayRefMoose::Util::TypeConstraints::OptimizedConstraints::ArrayRef
106116191µs191µsMoose::Util::TypeConstraints::OptimizedConstraints::::HashRefMoose::Util::TypeConstraints::OptimizedConstraints::HashRef
122271µs127µsMoose::Util::TypeConstraints::OptimizedConstraints::::ClassNameMoose::Util::TypeConstraints::OptimizedConstraints::ClassName
11114µs16µsMoose::Util::TypeConstraints::OptimizedConstraints::::BEGIN@3Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@3
1117µs38µsMoose::Util::TypeConstraints::OptimizedConstraints::::BEGIN@7Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@7
1117µs15µsMoose::Util::TypeConstraints::OptimizedConstraints::::BEGIN@4Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@4
1114µs4µsMoose::Util::TypeConstraints::OptimizedConstraints::::BEGIN@6Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@6
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::CodeRefMoose::Util::TypeConstraints::OptimizedConstraints::CodeRef
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::FileHandleMoose::Util::TypeConstraints::OptimizedConstraints::FileHandle
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::GlobRefMoose::Util::TypeConstraints::OptimizedConstraints::GlobRef
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::NumMoose::Util::TypeConstraints::OptimizedConstraints::Num
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::ObjectMoose::Util::TypeConstraints::OptimizedConstraints::Object
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::RefMoose::Util::TypeConstraints::OptimizedConstraints::Ref
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::RegexpRefMoose::Util::TypeConstraints::OptimizedConstraints::RegexpRef
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::RoleMoose::Util::TypeConstraints::OptimizedConstraints::Role
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::RoleNameMoose::Util::TypeConstraints::OptimizedConstraints::RoleName
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::ScalarRefMoose::Util::TypeConstraints::OptimizedConstraints::ScalarRef
0000s0sMoose::Util::TypeConstraints::OptimizedConstraints::::ValueMoose::Util::TypeConstraints::OptimizedConstraints::Value
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Util::TypeConstraints::OptimizedConstraints;
2
3320µs219µs
# spent 16µs (14+3) within Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@3 which was called # once (14µs+3µs) by Moose::Util::TypeConstraints::BEGIN@39 at line 3
use strict;
# spent 16µs making 1 call to Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@3 # spent 3µs making 1 call to strict::import
4319µs224µs
# spent 15µs (7+9) within Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@4 which was called # once (7µs+9µs) by Moose::Util::TypeConstraints::BEGIN@39 at line 4
use warnings;
# spent 15µs making 1 call to Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@4 # spent 9µs making 1 call to warnings::import
5
6330µs14µs
# spent 4µs within Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@6 which was called # once (4µs+0s) by Moose::Util::TypeConstraints::BEGIN@39 at line 6
use Class::MOP;
73366µs268µs
# spent 38µs (7+31) within Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@7 which was called # once (7µs+31µs) by Moose::Util::TypeConstraints::BEGIN@39 at line 7
use Scalar::Util 'blessed', 'looks_like_number';
# spent 38µs making 1 call to Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@7 # spent 31µs making 1 call to Exporter::import
8
91600nsour $VERSION = '0.98';
10119µs$VERSION = eval $VERSION;
111300nsour $AUTHORITY = 'cpan:STEVAN';
12
13sub Value { defined($_[0]) && !ref($_[0]) }
14
15sub Ref { ref($_[0]) }
16
17# We need to use a temporary here to flatten LVALUEs, for instance as in
18# Str(substr($_,0,255)).
19
# spent 1.57ms within Moose::Util::TypeConstraints::OptimizedConstraints::Str which was called 776 times, avg 2µs/call: # 758 times (1.52ms+0s) by SimpleDB::Class::Types::SdbIntAsStr or SimpleDB::Class::Types::SdbMediumStr or SimpleDB::Class::Types::SdbStr at line 249 of Moose/Meta/TypeConstraint.pm, avg 2µs/call # 7 times (28µs+0s) by SimpleDB::Class::Domain::new at line 28 of generated method (unknown origin), avg 4µs/call # 7 times (16µs+0s) by SimpleDB::Class::Domain::name at line 78 of accessor name defined at ../lib/SimpleDB/Class/Domain.pm, avg 2µs/call # 2 times (5µs+0s) by Moose::Meta::TypeConstraint::check at line 94 of Moose/Meta/TypeConstraint.pm, avg 2µs/call # once (2µs+0s) by SimpleDB::Class::ResultSet::new at line 62 of generated method (unknown origin) # once (2µs+0s) by SimpleDB::Class::ResultSet::limit at line 153 of accessor limit defined at ../lib/SimpleDB/Class/ResultSet.pm
sub Str {
2015522.42ms my $value = $_[0];
21 defined($value) && ref(\$value) eq 'SCALAR'
22}
23
24sub Num { !ref($_[0]) && looks_like_number($_[0]) }
25
261471.19ms1406.87ms
# spent 4.34ms (629µs+3.71) within Moose::Util::TypeConstraints::OptimizedConstraints::Int which was called 144 times, avg 30µs/call: # 88 times (368µs+3.59ms) by SimpleDB::Class::Types::SdbInt at line 249 of Moose/Meta/TypeConstraint.pm, avg 45µs/call # 18 times (108µs+48µs) by SimpleDB::Class::ResultSet::iterator at line 200 of accessor iterator defined at ../lib/SimpleDB/Class/ResultSet.pm, avg 9µs/call # 18 times (72µs+45µs) by SimpleDB::Class::ResultSet::limit_counter at line 214 of accessor limit_counter defined at ../lib/SimpleDB/Class/ResultSet.pm, avg 7µs/call # 10 times (54µs+27µs) by SimpleDB::Class::ResultSet::new at line 20 of generated method (unknown origin), avg 8µs/call # 10 times (27µs+8µs) by SimpleDB::Class::ResultSet::new at line 34 of generated method (unknown origin), avg 4µs/call
sub Int { defined($_[0]) && !ref($_[0]) && $_[0] =~ /^-?[0-9]+$/ }
# spent 3.71ms making 139 calls to Moose::Util::TypeConstraints::OptimizedConstraints::CORE:match, avg 27µs/call # spent 3.16ms making 1 call to utf8::AUTOLOAD
27
28sub ScalarRef { ref($_[0]) eq 'SCALAR' || ref($_[0]) eq 'REF' }
29186467µs
# spent 259µs within Moose::Util::TypeConstraints::OptimizedConstraints::ArrayRef which was called 186 times, avg 1µs/call: # 186 times (259µs+0s) by SimpleDB::Class::Types::SdbArrayRefOfDateTime or SimpleDB::Class::Types::SdbArrayRefOfStr at line 263 of Moose/Meta/TypeConstraint.pm, avg 1µs/call
sub ArrayRef { ref($_[0]) eq 'ARRAY' }
30106310µs
# spent 191µs within Moose::Util::TypeConstraints::OptimizedConstraints::HashRef which was called 106 times, avg 2µs/call: # 59 times (92µs+0s) by Moose::Meta::TypeConstraint::check at line 94 of Moose/Meta/TypeConstraint.pm, avg 2µs/call # 10 times (41µs+0s) by SimpleDB::Class::ResultSet::result at line 189 of accessor result defined at ../lib/SimpleDB/Class/ResultSet.pm, avg 4µs/call # 9 times (10µs+0s) by SimpleDB::Class::ResultSet::new at line 97 of generated method (unknown origin), avg 1µs/call # 8 times (11µ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 61 of Moose/Meta/TypeCoercion.pm, avg 1µs/call # 7 times (13µs+0s) by SimpleDB::Class::ResultSet::new at line 75 of generated method (unknown origin), avg 2µs/call # 4 times (4µs+0s) by Foo::Domain::properties at line 14 of generated method (unknown origin), avg 1µs/call # 3 times (6µs+0s) by SimpleDB::Class::ResultSet::new at line 69 of generated method (unknown origin), avg 2µs/call # 2 times (4µs+0s) by HashRef[Moose::Meta::Attribute] at line 249 of Moose/Meta/TypeConstraint.pm, avg 2µs/call # 2 times (4µs+0s) by MooseX::AttributeHelpers::Collection::Hash::method_constructors at line 55 of accessor method_constructors defined at MooseX/AttributeHelpers/Trait/Base.pm, avg 2µs/call # once (5µs+0s) by Class::MOP::Class::__ANON__::SERIAL::1::_class_attribute_values at line 41 of accessor _class_attribute_values defined at MooseX/ClassAttribute/Role/Meta/Class.pm # once (800ns+0s) by Foo::Domain::properties at line 6 of generated method (unknown origin)
sub HashRef { ref($_[0]) eq 'HASH' }
31sub CodeRef { ref($_[0]) eq 'CODE' }
32sub RegexpRef { ref($_[0]) eq 'Regexp' }
33sub GlobRef { ref($_[0]) eq 'GLOB' }
34
35sub FileHandle { ref($_[0]) eq 'GLOB' && Scalar::Util::openhandle($_[0]) or blessed($_[0]) && $_[0]->isa("IO::Handle") }
36
37sub Object { blessed($_[0]) && blessed($_[0]) ne 'Regexp' }
38
39sub Role { Carp::cluck('The Role type is deprecated.'); blessed($_[0]) && $_[0]->can('does') }
40
41
# spent 127µs (71+56) within Moose::Util::TypeConstraints::OptimizedConstraints::ClassName which was called 12 times, avg 11µs/call: # 10 times (61µs+47µs) by SimpleDB::Class::ResultSet::new at line 105 of generated method (unknown origin), avg 11µs/call # 2 times (11µs+8µs) by Moose::Meta::TypeConstraint::check at line 94 of Moose/Meta/TypeConstraint.pm, avg 10µs/call
sub ClassName {
4212134µs1256µs return Class::MOP::is_class_loaded( $_[0] );
# spent 56µs making 12 calls to Class::MOP::is_class_loaded, avg 5µs/call
43}
44
45sub RoleName {
46 ClassName($_[0])
47 && (Class::MOP::class_of($_[0]) || return)->isa('Moose::Meta::Role')
48}
49
50# NOTE:
51# we have XS versions too, ...
52# 04:09 <@konobi> nothingmuch: konobi.co.uk/code/utilsxs.tar.gz
53# 04:09 <@konobi> or utilxs.tar.gz iirc
54
5517µs1;
56
57__END__
58
59=pod
60
61=head1 NAME
62
63Moose::Util::TypeConstraints::OptimizedConstraints - Optimized constraint
64bodies for various moose types
65
66=head1 DESCRIPTION
67
68This file contains the hand optimized versions of Moose type constraints,
69no user serviceable parts inside.
70
71=head1 FUNCTIONS
72
73=over 4
74
75=item C<Value>
76
77=item C<Ref>
78
79=item C<Str>
80
81=item C<Num>
82
83=item C<Int>
84
85=item C<ScalarRef>
86
87=item C<ArrayRef>
88
89=item C<HashRef>
90
91=item C<CodeRef>
92
93=item C<RegexpRef>
94
95=item C<GlobRef>
96
97=item C<FileHandle>
98
99=item C<Object>
100
101=item C<Role>
102
103=item C<ClassName>
104
105=item C<RoleName>
106
107=back
108
109=head1 BUGS
110
111See L<Moose/BUGS> for details on reporting bugs.
112
113=head1 AUTHOR
114
115Yuval Kogman E<lt>nothingmuch@cpan.orgE<gt>
116
117=head1 COPYRIGHT AND LICENSE
118
119Copyright 2007-2009 by Infinity Interactive, Inc.
120
121L<http://www.iinteractive.com>
122
123This library is free software; you can redistribute it and/or modify
124it under the same terms as Perl itself.
125
126=cut
# spent 3.71ms (436µs+3.28) within Moose::Util::TypeConstraints::OptimizedConstraints::CORE:match which was called 139 times, avg 27µs/call: # 139 times (436µs+3.28ms) by Moose::Util::TypeConstraints::OptimizedConstraints::Int at line 26 of Moose/Util/TypeConstraints/OptimizedConstraints.pm, avg 27µs/call
sub Moose::Util::TypeConstraints::OptimizedConstraints::CORE:match; # xsub