| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/MooseX/Types/CheckedUtilExports.pm |
| Statements | Executed 106 statements in 2.63ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 17 | 1 | 1 | 505µs | 505µs | MooseX::Types::CheckedUtilExports::__ANON__[:64] |
| 1 | 1 | 1 | 86µs | 105µs | MooseX::Types::CheckedUtilExports::BEGIN@11 |
| 1 | 1 | 1 | 47µs | 165µs | MooseX::Types::CheckedUtilExports::BEGIN@14 |
| 1 | 1 | 1 | 45µs | 224µs | MooseX::Types::CheckedUtilExports::BEGIN@15 |
| 1 | 1 | 1 | 42µs | 232µs | MooseX::Types::CheckedUtilExports::BEGIN@16 |
| 1 | 1 | 1 | 40µs | 912µs | MooseX::Types::CheckedUtilExports::BEGIN@18 |
| 1 | 1 | 1 | 39µs | 106µs | MooseX::Types::CheckedUtilExports::BEGIN@12 |
| 1 | 1 | 1 | 38µs | 105µs | MooseX::Types::CheckedUtilExports::BEGIN@50 |
| 1 | 1 | 1 | 20µs | 20µs | MooseX::Types::CheckedUtilExports::BEGIN@13 |
| 0 | 0 | 0 | 0s | 0s | MooseX::Types::CheckedUtilExports::class_type |
| 0 | 0 | 0 | 0s | 0s | MooseX::Types::CheckedUtilExports::role_type |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | =head1 NAME | ||||
| 2 | |||||
| - - | |||||
| 8 | package MooseX::Types::CheckedUtilExports; | ||||
| 9 | 1 | 3µs | our $VERSION = "0.23"; | ||
| 10 | |||||
| 11 | 3 | 102µs | 2 | 123µs | # spent 105µs (86+18) within MooseX::Types::CheckedUtilExports::BEGIN@11 which was called:
# once (86µs+18µs) by MooseX::Types::BEGIN@15 at line 11 # spent 105µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@11
# spent 18µs making 1 call to strict::import |
| 12 | 3 | 94µs | 2 | 174µs | # spent 106µs (39+68) within MooseX::Types::CheckedUtilExports::BEGIN@12 which was called:
# once (39µs+68µs) by MooseX::Types::BEGIN@15 at line 12 # spent 106µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@12
# spent 68µs making 1 call to warnings::import |
| 13 | 3 | 82µs | 1 | 20µs | # spent 20µs within MooseX::Types::CheckedUtilExports::BEGIN@13 which was called:
# once (20µs+0s) by MooseX::Types::BEGIN@15 at line 13 # spent 20µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@13 |
| 14 | 3 | 100µs | 2 | 283µs | # spent 165µs (47+118) within MooseX::Types::CheckedUtilExports::BEGIN@14 which was called:
# once (47µs+118µs) by MooseX::Types::BEGIN@15 at line 14 # spent 165µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@14
# spent 118µs making 1 call to Moose::Exporter::import |
| 15 | 3 | 115µs | 2 | 404µs | # spent 224µs (45+180) within MooseX::Types::CheckedUtilExports::BEGIN@15 which was called:
# once (45µs+180µs) by MooseX::Types::BEGIN@15 at line 15 # spent 224µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@15
# spent 180µs making 1 call to Exporter::import |
| 16 | 3 | 116µs | 2 | 422µs | # spent 232µs (42+190) within MooseX::Types::CheckedUtilExports::BEGIN@16 which was called:
# once (42µs+190µs) by MooseX::Types::BEGIN@15 at line 16 # spent 232µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@16
# spent 190µs making 1 call to Exporter::import |
| 17 | |||||
| 18 | 3 | 246µs | 2 | 1.78ms | # spent 912µs (40+872) within MooseX::Types::CheckedUtilExports::BEGIN@18 which was called:
# once (40µs+872µs) by MooseX::Types::BEGIN@15 at line 18 # spent 912µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@18
# spent 872µs making 1 call to namespace::clean::import |
| 19 | |||||
| 20 | 1 | 3µs | my $StringFoundMsg = | ||
| 21 | q{WARNING: String found where Type expected (did you use a => instead of a , ?)}; | ||||
| 22 | |||||
| 23 | 1 | 9µs | my @exports = qw/type subtype maybe_type duck_type enum coerce from as/; | ||
| 24 | |||||
| 25 | =head1 DESCRIPTION | ||||
| 26 | |||||
| - - | |||||
| 49 | 1 | 5µs | for my $export (@exports) { | ||
| 50 | 3 | 812µs | 2 | 173µs | # spent 105µs (38+67) within MooseX::Types::CheckedUtilExports::BEGIN@50 which was called:
# once (38µs+67µs) by MooseX::Types::BEGIN@15 at line 50 # spent 105µs making 1 call to MooseX::Types::CheckedUtilExports::BEGIN@50
# spent 67µs making 1 call to strict::unimport |
| 51 | |||||
| 52 | # spent 505µs within MooseX::Types::CheckedUtilExports::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/MooseX/Types/CheckedUtilExports.pm:64] which was called 17 times, avg 30µs/call:
# 17 times (505µs+0s) by MooseX::Types::CheckedUtilExports::as or MooseX::Types::CheckedUtilExports::enum or MooseX::Types::CheckedUtilExports::subtype at line 338 of Moose/Exporter.pm, avg 30µs/call | ||||
| 53 | 68 | 701µs | my $caller = shift; | ||
| 54 | |||||
| 55 | local $Carp::CarpLevel = $Carp::CarpLevel + 1; | ||||
| 56 | |||||
| 57 | carp $StringFoundMsg | ||||
| 58 | unless ref($_[0]) || | ||||
| 59 | $_[0] =~ /\b::\b/ || # qualified type | ||||
| 60 | $caller->get_registered_class_type($_[0]) || | ||||
| 61 | $caller->get_registered_role_type($_[0]); | ||||
| 62 | |||||
| 63 | 17 | 16.5ms | goto &{"Moose::Util::TypeConstraints::$export"}; # spent 14.5ms making 8 calls to Moose::Util::TypeConstraints::subtype, avg 1.81ms/call
# spent 1.90ms making 1 call to Moose::Util::TypeConstraints::enum
# spent 156µs making 8 calls to Moose::Util::TypeConstraints::as, avg 19µs/call | ||
| 64 | } | ||||
| 65 | 8 | 144µs | } | ||
| 66 | |||||
| 67 | Moose::Exporter->setup_import_methods( | ||||
| 68 | 1 | 22µs | 1 | 4.06ms | with_caller => [ @exports, 'class_type', 'role_type' ] # spent 4.06ms making 1 call to Moose::Exporter::setup_import_methods |
| 69 | ); | ||||
| 70 | |||||
| 71 | sub class_type { | ||||
| 72 | my $caller = shift; | ||||
| 73 | |||||
| 74 | $caller->register_class_type( | ||||
| 75 | Moose::Util::TypeConstraints::class_type(@_) | ||||
| 76 | ); | ||||
| 77 | } | ||||
| 78 | |||||
| 79 | sub role_type ($;$) { | ||||
| 80 | my ($caller, $name, $opts) = @_; | ||||
| 81 | |||||
| 82 | $caller->register_role_type( | ||||
| 83 | Moose::Util::TypeConstraints::role_type($name, $opts) | ||||
| 84 | ); | ||||
| 85 | } | ||||
| 86 | |||||
| 87 | =head1 SEE ALSO | ||||
| 88 | |||||
| - - | |||||
| 102 | 1 | 76µs | 1 | 1.55ms | 1; # spent 1.55ms making 1 call to B::Hooks::EndOfScope::__ANON__[B/Hooks/EndOfScope.pm:26] |