| File | /usr/local/lib/perl5/site_perl/5.10.1/MooseX/Types/Moose.pm |
| Statements Executed | 62 |
| Statement Execution Time | 280µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 45 | 3 | 1 | 29µs | 29µs | MooseX::Types::Moose::type_storage |
| 1 | 1 | 1 | 15µs | 25µs | MooseX::Types::Moose::BEGIN@9 |
| 1 | 1 | 1 | 8µs | 368µs | MooseX::Types::Moose::BEGIN@15 |
| 1 | 1 | 1 | 7µs | 10µs | MooseX::Types::Moose::BEGIN@10 |
| 1 | 1 | 1 | 6µs | 2.23ms | MooseX::Types::Moose::BEGIN@12 |
| 1 | 1 | 1 | 4µs | 4µs | MooseX::Types::Moose::BEGIN@13 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package MooseX::Types::Moose; | ||||
| 2 | |||||
| 3 | =head1 NAME | ||||
| 4 | |||||
| 5 | MooseX::Types::Moose - Types shipped with L<Moose> | ||||
| 6 | |||||
| 7 | =cut | ||||
| 8 | |||||
| 9 | 3 | 22µs | 2 | 35µs | # spent 25µs (15+10) within MooseX::Types::Moose::BEGIN@9 which was called
# once (15µs+10µs) by SimpleDB::Class::Types::BEGIN@83 at line 9 # spent 25µs making 1 call to MooseX::Types::Moose::BEGIN@9
# spent 10µs making 1 call to warnings::import |
| 10 | 3 | 19µs | 2 | 12µs | # spent 10µs (7+2) within MooseX::Types::Moose::BEGIN@10 which was called
# once (7µs+2µs) by SimpleDB::Class::Types::BEGIN@83 at line 10 # spent 10µs making 1 call to MooseX::Types::Moose::BEGIN@10
# spent 2µs making 1 call to strict::import |
| 11 | |||||
| 12 | 3 | 24µs | 2 | 4.45ms | # spent 2.23ms (6µs+2.22) within MooseX::Types::Moose::BEGIN@12 which was called
# once (6µs+2.22ms) by SimpleDB::Class::Types::BEGIN@83 at line 12 # spent 2.23ms making 1 call to MooseX::Types::Moose::BEGIN@12
# spent 2.22ms making 1 call to MooseX::Types::import |
| 13 | 3 | 24µs | 1 | 4µs | # spent 4µs within MooseX::Types::Moose::BEGIN@13 which was called
# once (4µs+0s) by SimpleDB::Class::Types::BEGIN@83 at line 13 # spent 4µs making 1 call to MooseX::Types::Moose::BEGIN@13 |
| 14 | |||||
| 15 | 3 | 80µs | 2 | 728µs | # spent 368µs (8+360) within MooseX::Types::Moose::BEGIN@15 which was called
# once (8µs+360µs) by SimpleDB::Class::Types::BEGIN@83 at line 15 # spent 368µs making 1 call to MooseX::Types::Moose::BEGIN@15
# spent 360µs making 1 call to namespace::clean::import |
| 16 | |||||
| 17 | =head1 SYNOPSIS | ||||
| 18 | |||||
| 19 | package Foo; | ||||
| 20 | use Moose; | ||||
| 21 | use MooseX::Types::Moose qw( Int Str ); | ||||
| 22 | use Carp qw( croak ); | ||||
| 23 | |||||
| 24 | has 'name', | ||||
| 25 | is => 'rw', | ||||
| 26 | isa => Str; | ||||
| 27 | |||||
| 28 | has 'id', | ||||
| 29 | is => 'rw', | ||||
| 30 | isa => Int; | ||||
| 31 | |||||
| 32 | sub add { | ||||
| 33 | my ($self, $x, $y) = @_; | ||||
| 34 | croak 'First arg not an Int' unless is_Int($x); | ||||
| 35 | croak 'Second arg not an Int' unless is_Int($y); | ||||
| 36 | return $x + $y; | ||||
| 37 | } | ||||
| 38 | |||||
| 39 | 1; | ||||
| 40 | |||||
| 41 | =head1 DESCRIPTION | ||||
| 42 | |||||
| 43 | This package contains a virtual library for L<MooseX::Types> that | ||||
| 44 | is able to export all types known to L<Moose>. See L<MooseX::Types> | ||||
| 45 | for general usage information. | ||||
| 46 | |||||
| 47 | =cut | ||||
| 48 | |||||
| 49 | # all available builtin types as short and long name | ||||
| 50 | my %BuiltIn_Storage | ||||
| 51 | 1 | 32µs | 1 | 9µs | = map { ($_) x 2 } # spent 9µs making 1 call to Moose::Util::TypeConstraints::list_all_builtin_type_constraints |
| 52 | Moose::Util::TypeConstraints->list_all_builtin_type_constraints; | ||||
| 53 | |||||
| 54 | =head1 METHODS | ||||
| 55 | |||||
| 56 | =head2 type_storage | ||||
| 57 | |||||
| 58 | Overrides L<MooseX::Types::Base>' C<type_storage> to provide a hash | ||||
| 59 | reference containing all built-in L<Moose> types. | ||||
| 60 | |||||
| 61 | =cut | ||||
| 62 | |||||
| 63 | # use prepopulated builtin hash as type storage | ||||
| 64 | 45 | 64µs | # spent 29µs within MooseX::Types::Moose::type_storage which was called 45 times, avg 647ns/call:
# 22 times (15µs+0s) by MooseX::Types::Base::has_type at line 171 of MooseX/Types/Base.pm, avg 682ns/call
# 22 times (13µs+0s) by MooseX::Types::Base::get_type at line 131 of MooseX/Types/Base.pm, avg 605ns/call
# once (800ns+0s) by MooseX::Types::Base::type_names at line 144 of MooseX/Types/Base.pm | ||
| 65 | |||||
| 66 | =head1 SEE ALSO | ||||
| 67 | |||||
| 68 | L<MooseX::Types::Moose>, | ||||
| 69 | L<Moose>, | ||||
| 70 | L<Moose::Util::TypeConstraints> | ||||
| 71 | |||||
| 72 | =head1 AUTHOR | ||||
| 73 | |||||
| 74 | See L<MooseX::Types/AUTHOR>. | ||||
| 75 | |||||
| 76 | =head1 LICENSE | ||||
| 77 | |||||
| 78 | This program is free software; you can redistribute it and/or modify | ||||
| 79 | it under the same terms as perl itself. | ||||
| 80 | |||||
| 81 | =cut | ||||
| 82 | |||||
| 83 | 1 | 14µs | 1 | 367µs | 1; # spent 367µs making 1 call to B::Hooks::EndOfScope::__ANON__[B/Hooks/EndOfScope.pm:47] |