Profile of /usr/local/lib/perl5/site_perl/5.10.1/MooseX/Types/CheckedUtilExports.pm

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

File | /usr/local/lib/perl5/site_perl/5.10.1/MooseX/Types/CheckedUtilExports.pm
Statements Executed | 279
Statement Execution Time | 765µs

Subroutines — ordered by exclusive time
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
60 | 1 | 1 | 242µs | 263µs | MooseX::Types::CheckedUtilExports::::__ANON__[:63]MooseX::Types::CheckedUtilExports::__ANON__[:63]
2 | 2 | 2 | 17µs | 506µs | MooseX::Types::CheckedUtilExports::::class_typeMooseX::Types::CheckedUtilExports::class_type
1 | 1 | 1 | 15µs | 18µs | MooseX::Types::CheckedUtilExports::::BEGIN@10MooseX::Types::CheckedUtilExports::BEGIN@10
1 | 1 | 1 | 11µs | 48µs | MooseX::Types::CheckedUtilExports::::BEGIN@15MooseX::Types::CheckedUtilExports::BEGIN@15
1 | 1 | 1 | 8µs | 35µs | MooseX::Types::CheckedUtilExports::::BEGIN@14MooseX::Types::CheckedUtilExports::BEGIN@14
1 | 1 | 1 | 8µs | 179µs | MooseX::Types::CheckedUtilExports::::BEGIN@17MooseX::Types::CheckedUtilExports::BEGIN@17
1 | 1 | 1 | 7µs | 16µs | MooseX::Types::CheckedUtilExports::::BEGIN@11MooseX::Types::CheckedUtilExports::BEGIN@11
1 | 1 | 1 | 7µs | 27µs | MooseX::Types::CheckedUtilExports::::BEGIN@13MooseX::Types::CheckedUtilExports::BEGIN@13
1 | 1 | 1 | 7µs | 21µs | MooseX::Types::CheckedUtilExports::::BEGIN@49MooseX::Types::CheckedUtilExports::BEGIN@49
1 | 1 | 1 | 3µs | 3µs | MooseX::Types::CheckedUtilExports::::BEGIN@12MooseX::Types::CheckedUtilExports::BEGIN@12
1 | 1 | 2 | 800ns | 800ns | MooseX::Types::CheckedUtilExports::::CORE:matchMooseX::Types::CheckedUtilExports::CORE:match (opcode)
0 | 0 | 0 | 0s | 0s | MooseX::Types::CheckedUtilExports::::role_typeMooseX::Types::CheckedUtilExports::role_type

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | =head1 NAME
2 |  |  |  |  |
3 |  |  |  |  | MooseX::Types::CheckedUtilExports - Wrap L<Moose::Util::TypeConstraints> to be
4 |  |  |  |  | safer for L<MooseX::Types>
5 |  |  |  |  |
6 |  |  |  |  | =cut
7 |  |  |  |  |
8 |  |  |  |  | package MooseX::Types::CheckedUtilExports;
9 |  |  |  |  |
10 | 3 | 21µs | 2 | 21µs | # spent 18µs (15+3) within MooseX::Types::CheckedUtilExports::BEGIN@10 which was called # once (15µs+3µs) by MooseX::Types::BEGIN@15 at line 10 use strict; # spent 18µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@10 # spent 3µs making 1 call to strict::import
11 | 3 | 18µs | 2 | 25µs | # spent 16µs (7+9) within MooseX::Types::CheckedUtilExports::BEGIN@11 which was called # once (7µs+9µs) by MooseX::Types::BEGIN@15 at line 11 use warnings; # spent 16µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@11 # spent 9µs making 1 call to warnings::import
12 | 3 | 16µs | 1 | 3µs | # spent 3µs within MooseX::Types::CheckedUtilExports::BEGIN@12 which was called # once (3µs+0s) by MooseX::Types::BEGIN@15 at line 12 use Moose::Util::TypeConstraints (); # spent 3µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@12
13 | 3 | 21µs | 2 | 47µs | # spent 27µs (7+20) within MooseX::Types::CheckedUtilExports::BEGIN@13 which was called # once (7µs+20µs) by MooseX::Types::BEGIN@15 at line 13 use Moose::Exporter; # spent 27µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@13 # spent 20µs making 1 call to Moose::Exporter::import
14 | 3 | 34µs | 2 | 62µs | # spent 35µs (8+27) within MooseX::Types::CheckedUtilExports::BEGIN@14 which was called # once (8µs+27µs) by MooseX::Types::BEGIN@15 at line 14 use Sub::Name; # spent 35µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@14 # spent 27µs making 1 call to Exporter::import
15 | 3 | 34µs | 2 | 84µs | # spent 48µs (11+36) within MooseX::Types::CheckedUtilExports::BEGIN@15 which was called # once (11µs+36µs) by MooseX::Types::BEGIN@15 at line 15 use Carp; # spent 48µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@15 # spent 36µs making 1 call to Exporter::import
16 |  |  |  |  |
17 | 3 | 48µs | 2 | 350µs | # spent 179µs (8+171) within MooseX::Types::CheckedUtilExports::BEGIN@17 which was called # once (8µs+171µs) by MooseX::Types::BEGIN@15 at line 17 use namespace::clean -except => 'meta'; # spent 179µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@17 # spent 171µs making 1 call to namespace::clean::import
18 |  |  |  |  |
19 | 1 | 400ns |  |  | my $StringFoundMsg =
20 |  |  |  |  | q{WARNING: String found where Type expected (did you use a => instead of a , ?)};
21 |  |  |  |  |
22 | 1 | 2µs |  |  | my @exports = qw/type subtype maybe_type duck_type enum coerce from as/;
23 |  |  |  |  |
24 |  |  |  |  | =head1 DESCRIPTION
25 |  |  |  |  |
26 |  |  |  |  | Prevents errors like:
27 |  |  |  |  |
28 |  |  |  |  | subtype Foo =>
29 |  |  |  |  | ...
30 |  |  |  |  |
31 |  |  |  |  | Which should be written as:
32 |  |  |  |  |
33 |  |  |  |  | subtype Foo,
34 |  |  |  |  | ...
35 |  |  |  |  |
36 |  |  |  |  | When using L<MooseX::Types>. Exported by that module.
37 |  |  |  |  |
38 |  |  |  |  | Exports checked versions of the following subs:
39 |  |  |  |  |
40 |  |  |  |  | C<type> C<subtype> C<maybe_type> C<duck_type> C<enum> C<coerce> C<from> C<as>
41 |  |  |  |  |
42 |  |  |  |  | While C<class_type> and C<role_type> will also register the type in the library.
43 |  |  |  |  |
44 |  |  |  |  | From L<Moose::Util::TypeConstraints>. See that module for syntax.
45 |  |  |  |  |
46 |  |  |  |  | =cut
47 |  |  |  |  |
48 | 1 | 400ns |  |  | for my $export (@exports) {
49 | 3 | 190µs | 2 | 35µs | # spent 21µs (7+14) within MooseX::Types::CheckedUtilExports::BEGIN@49 which was called # once (7µs+14µs) by MooseX::Types::BEGIN@15 at line 49 no strict 'refs'; # spent 21µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@49 # spent 14µs making 1 call to strict::unimport
50 |  |  |  |  |
51 |  |  |  |  | # spent 263µs (242+21) within MooseX::Types::CheckedUtilExports::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/MooseX/Types/CheckedUtilExports.pm:63] which was called 60 times, avg 4µs/call: # 60 times (242µs+21µs) by MooseX::Types::CheckedUtilExports::as or MooseX::Types::CheckedUtilExports::coerce or MooseX::Types::CheckedUtilExports::from or MooseX::Types::CheckedUtilExports::subtype at line 272 of Moose/Exporter.pm, avg 4µs/call *{$export} = sub {
52 | 60 | 15µs |  |  | my $caller = shift;
53 |  |  |  |  |
54 | 60 | 20µs |  |  | local $Carp::CarpLevel = $Carp::CarpLevel + 1;
55 |  |  |  |  |
56 | 60 | 32µs | 4 | 20µs | carp $StringFoundMsg # spent 10µs making 1 call to MooseX::Types::Base::get_registered_class_type # spent 10µs making 2 calls to Moose::Meta::TypeConstraint::__ANON__[Moose/Meta/TypeConstraint.pm:8], avg 5µs/call # spent 800ns making 1 call to MooseX::Types::CheckedUtilExports::CORE:match
57 |  |  |  |  | unless ref($_[0]) ||
58 |  |  |  |  | $_[0] =~ /\b::\b/ || # qualified type
59 |  |  |  |  | $caller->get_registered_class_type($_[0]) ||
60 |  |  |  |  | $caller->get_registered_role_type($_[0]);
61 |  |  |  |  |
62 | 60 | 256µs | 60 | 6.47ms | goto &{"Moose::Util::TypeConstraints::$export"}; # spent 3.37ms making 10 calls to Moose::Util::TypeConstraints::coerce, avg 337µs/call # spent 3.06ms making 10 calls to Moose::Util::TypeConstraints::subtype, avg 306µs/call # spent 32µs making 30 calls to Moose::Util::TypeConstraints::from, avg 1µs/call # spent 18µs making 10 calls to Moose::Util::TypeConstraints::as, avg 2µs/call
63 |  |  |  |  | }
64 | 8 | 25µs |  |  | }
65 |  |  |  |  |
66 |  |  |  |  | Moose::Exporter->setup_import_methods(
67 | 1 | 5µs | 1 | 709µs | with_caller => [ @exports, 'class_type', 'role_type' ] # spent 709µs making 1 call to Moose::Exporter::setup_import_methods
68 |  |  |  |  | );
69 |  |  |  |  |
70 |  |  |  |  | # spent 506µs (17+489) within MooseX::Types::CheckedUtilExports::class_type which was called 2 times, avg 253µs/call: # once (4µs+251µs) by SimpleDB::Class::Role::Itemized::BEGIN@4 at line 98 of ../lib/SimpleDB/Class/Types.pm # once (12µs+239µs) by MooseX::Types::CheckedUtilExports::class_type at line 272 of Moose/Exporter.pm sub class_type {
71 | 1 | 700ns |  |  | my $caller = shift;
72 |  |  |  |  |
73 | 1 | 10µs | 2 | 239µs | $caller->register_class_type( # spent 214µs making 1 call to Moose::Util::TypeConstraints::class_type # spent 24µs making 1 call to MooseX::Types::Base::register_class_type
74 |  |  |  |  | Moose::Util::TypeConstraints::class_type(@_)
75 |  |  |  |  | );
76 |  |  |  |  | }
77 |  |  |  |  |
78 |  |  |  |  | sub role_type ($;$) {
79 |  |  |  |  | my ($caller, $name, $opts) = @_;
80 |  |  |  |  |
81 |  |  |  |  | $caller->register_role_type(
82 |  |  |  |  | Moose::Util::TypeConstraints::role_type($name, $opts)
83 |  |  |  |  | );
84 |  |  |  |  | }
85 |  |  |  |  |
86 |  |  |  |  | =head1 SEE ALSO
87 |  |  |  |  |
88 |  |  |  |  | L<MooseX::Types>
89 |  |  |  |  |
90 |  |  |  |  | =head1 AUTHOR
91 |  |  |  |  |
92 |  |  |  |  | See L<MooseX::Types/AUTHOR>.
93 |  |  |  |  |
94 |  |  |  |  | =head1 LICENSE
95 |  |  |  |  |
96 |  |  |  |  | This program is free software; you can redistribute it and/or modify
97 |  |  |  |  | it under the same terms as perl itself.
98 |  |  |  |  |
99 |  |  |  |  | =cut
100 |  |  |  |  |
101 | 1 | 19µs | 1 | 93µs | 1; # spent 93µs making 1 call to B::Hooks::EndOfScope::__ANON__[B/Hooks/EndOfScope.pm:47]
|  |  |  |  | # spent 800ns within MooseX::Types::CheckedUtilExports::CORE:match which was called # once (800ns+0s) by MooseX::Types::CheckedUtilExports::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/MooseX/Types/CheckedUtilExports.pm:63] at line 56 of MooseX/Types/CheckedUtilExports.pm sub MooseX::Types::CheckedUtilExports::CORE:match; # xsub