Filename | /opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm |
Statements | Executed 138 statements in 3.64ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 582µs | 14.8ms | define_builtins | Moose::Util::TypeConstraints::Builtins::
6 | 1 | 1 | 57µs | 243µs | __ANON__[:66] | Moose::Util::TypeConstraints::Builtins::
16 | 16 | 1 | 28µs | 28µs | where | Moose::Util::TypeConstraints::Builtins::
17 | 17 | 1 | 21µs | 21µs | inline_as | Moose::Util::TypeConstraints::Builtins::
16 | 16 | 1 | 20µs | 20µs | subtype | Moose::Util::TypeConstraints::Builtins::
16 | 16 | 1 | 19µs | 19µs | as | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 19µs | 60µs | BEGIN@12 | Moose::Util::TypeConstraints::Builtins::
3 | 1 | 1 | 19µs | 224µs | __ANON__[:120] | Moose::Util::TypeConstraints::Builtins::
7 | 1 | 1 | 13µs | 13µs | __ANON__[:46] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 13µs | 13µs | BEGIN@2 | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 12µs | 83µs | __ANON__[:83] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 11µs | 40µs | __ANON__[:176] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 11µs | 18µs | BEGIN@10 | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 10µs | 29µs | BEGIN@9 | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 10µs | 56µs | BEGIN@14 | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 9µs | 68µs | __ANON__[:112] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 8µs | 8µs | BEGIN@13 | Moose::Util::TypeConstraints::Builtins::
2 | 1 | 1 | 4µs | 4µs | __ANON__[:163] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 4µs | 4µs | __ANON__[:152] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 4µs | 4µs | __ANON__[:58] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 3µs | 3µs | __ANON__[:195] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 3µs | 3µs | __ANON__[:125] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 2µs | 2µs | __ANON__[:137] | Moose::Util::TypeConstraints::Builtins::
2 | 1 | 1 | 2µs | 2µs | __ANON__[:28] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 2µs | 2µs | __ANON__[:223] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 2µs | 2µs | __ANON__[:258] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 2µs | 2µs | __ANON__[:39] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 2µs | 2µs | __ANON__[:72] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 2µs | 2µs | __ANON__[:132] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 2µs | 2µs | __ANON__[:157] | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 2µs | 2µs | type | Moose::Util::TypeConstraints::Builtins::
1 | 1 | 1 | 1µs | 1µs | __ANON__[:291] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:116] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:124] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:136] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:146] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:156] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:161] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:169] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:184] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:190] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:191] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:202] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:212] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:221] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:222] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:237] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:247] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:256] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:257] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:272] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:27] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:282] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:289] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:290] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:298] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:32] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:36] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:43] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:50] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:62] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:70] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:76] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | __ANON__[:97] | Moose::Util::TypeConstraints::Builtins::
0 | 0 | 0 | 0s | 0s | optimize_as | Moose::Util::TypeConstraints::Builtins::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moose::Util::TypeConstraints::Builtins; | ||||
2 | # spent 13µs within Moose::Util::TypeConstraints::Builtins::BEGIN@2 which was called:
# once (13µs+0s) by Moose::Meta::Attribute::BEGIN@24 at line 4 | ||||
3 | 1 | 7µs | $Moose::Util::TypeConstraints::Builtins::AUTHORITY = 'cpan:STEVAN'; | ||
4 | 1 | 50µs | 1 | 13µs | } # spent 13µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@2 |
5 | { | ||||
6 | 2 | 2µs | $Moose::Util::TypeConstraints::Builtins::VERSION = '2.1005'; | ||
7 | } | ||||
8 | |||||
9 | 2 | 39µs | 2 | 48µs | # spent 29µs (10+19) within Moose::Util::TypeConstraints::Builtins::BEGIN@9 which was called:
# once (10µs+19µs) by Moose::Meta::Attribute::BEGIN@24 at line 9 # spent 29µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@9
# spent 19µs making 1 call to strict::import |
10 | 2 | 36µs | 2 | 26µs | # spent 18µs (11+7) within Moose::Util::TypeConstraints::Builtins::BEGIN@10 which was called:
# once (11µs+7µs) by Moose::Meta::Attribute::BEGIN@24 at line 10 # spent 18µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@10
# spent 7µs making 1 call to warnings::import |
11 | |||||
12 | 2 | 37µs | 2 | 100µs | # spent 60µs (19+41) within Moose::Util::TypeConstraints::Builtins::BEGIN@12 which was called:
# once (19µs+41µs) by Moose::Meta::Attribute::BEGIN@24 at line 12 # spent 60µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@12
# spent 41µs making 1 call to Exporter::import |
13 | 2 | 31µs | 1 | 8µs | # spent 8µs within Moose::Util::TypeConstraints::Builtins::BEGIN@13 which was called:
# once (8µs+0s) by Moose::Meta::Attribute::BEGIN@24 at line 13 # spent 8µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@13 |
14 | 2 | 2.72ms | 2 | 102µs | # spent 56µs (10+46) within Moose::Util::TypeConstraints::Builtins::BEGIN@14 which was called:
# once (10µs+46µs) by Moose::Meta::Attribute::BEGIN@24 at line 14 # spent 56µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@14
# spent 46µs making 1 call to Exporter::import |
15 | |||||
16 | 1 | 4µs | 1 | 5.70ms | # spent 2µs within Moose::Util::TypeConstraints::Builtins::type which was called:
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 28 # spent 5.70ms making 1 call to Moose::Util::TypeConstraints::type |
17 | 16 | 70µs | 16 | 6.93ms | # spent 20µs within Moose::Util::TypeConstraints::Builtins::subtype which was called 16 times, avg 1µs/call:
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 32
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 157
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 112
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 46
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 39
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 72
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 125
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 137
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 163
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 152
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 176
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 120
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 132
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 58
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 66
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 83 # spent 6.93ms making 16 calls to Moose::Util::TypeConstraints::subtype, avg 433µs/call |
18 | 16 | 64µs | 16 | 32µs | # spent 19µs within Moose::Util::TypeConstraints::Builtins::as which was called 16 times, avg 1µs/call:
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 32
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 58
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 66
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 83
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 120
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 152
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 176
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 163
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 125
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 137
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 157
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 132
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 112
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 39
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 46
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 72 # spent 32µs making 16 calls to Moose::Util::TypeConstraints::as, avg 2µs/call |
19 | 16 | 95µs | 16 | 28µs | # spent 28µs within Moose::Util::TypeConstraints::Builtins::where which was called 16 times, avg 2µs/call:
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 163
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 28
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 112
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 176
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 83
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 72
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 157
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 39
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 152
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 120
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 66
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 58
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 46
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 137
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 125
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 132 # spent 28µs making 16 calls to Moose::Util::TypeConstraints::where, avg 2µs/call |
20 | sub optimize_as (&) { goto &Moose::Util::TypeConstraints::optimize_as } | ||||
21 | 17 | 75µs | 17 | 23µs | # spent 21µs within Moose::Util::TypeConstraints::Builtins::inline_as which was called 17 times, avg 1µs/call:
# once (2µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 32
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 28
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 120
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 112
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 72
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 66
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 132
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 58
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 83
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 163
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 176
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 152
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 157
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 46
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 39
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 125
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 137 # spent 23µs making 17 calls to Moose::Util::TypeConstraints::inline_as, avg 1µs/call |
22 | |||||
23 | # spent 14.8ms (582µs+14.2) within Moose::Util::TypeConstraints::Builtins::define_builtins which was called:
# once (582µs+14.2ms) by Moose::Meta::Attribute::BEGIN@24 at line 727 of Moose/Util/TypeConstraints.pm | ||||
24 | 1 | 400ns | my $registry = shift; | ||
25 | |||||
26 | type 'Any' # meta-type including all | ||||
27 | => where {1} | ||||
28 | 3 | 15µs | 3 | 5µs | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:28] which was called 2 times, avg 1µs/call:
# 2 times (2µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 1µs/call # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::type
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as |
29 | |||||
30 | subtype 'Item' # base type | ||||
31 | => as 'Any' | ||||
32 | 1 | 8µs | 3 | 5µs | => inline_as { '1' }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as |
33 | |||||
34 | subtype 'Undef' | ||||
35 | => as 'Item' | ||||
36 | => where { !defined($_) } | ||||
37 | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:39] which was called:
# once (2µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
38 | 1 | 6µs | '!defined(' . $_[1] . ')' | ||
39 | 1 | 10µs | 4 | 5µs | }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as |
40 | |||||
41 | subtype 'Defined' | ||||
42 | => as 'Item' | ||||
43 | => where { defined($_) } | ||||
44 | # spent 13µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:46] which was called 7 times, avg 2µs/call:
# 7 times (13µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 2µs/call | ||||
45 | 7 | 24µs | 'defined(' . $_[1] . ')' | ||
46 | 1 | 11µs | 4 | 5µs | }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as |
47 | |||||
48 | subtype 'Bool' | ||||
49 | => as 'Item' | ||||
50 | => where { !defined($_) || $_ eq "" || "$_" eq '1' || "$_" eq '0' } | ||||
51 | # spent 4µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:58] which was called:
# once (4µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
52 | 1 | 7µs | '(' | ||
53 | . '!defined(' . $_[1] . ') ' | ||||
54 | . '|| ' . $_[1] . ' eq "" ' | ||||
55 | . '|| (' . $_[1] . '."") eq "1" ' | ||||
56 | . '|| (' . $_[1] . '."") eq "0"' | ||||
57 | . ')' | ||||
58 | 1 | 11µs | 4 | 5µs | }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
59 | |||||
60 | subtype 'Value' | ||||
61 | => as 'Defined' | ||||
62 | => where { !ref($_) } | ||||
63 | # spent 243µs (57+186) within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:66] which was called 6 times, avg 40µs/call:
# 6 times (57µs+186µs) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 40µs/call | ||||
64 | 6 | 34µs | 12 | 9µs | $_[0]->parent()->_inline_check($_[1]) # spent 9µs making 6 calls to Moose::Meta::TypeConstraint::parent, avg 2µs/call
# spent 177µs making 6 calls to Moose::Meta::TypeConstraint::_inline_check, avg 29µs/call, recursion: max depth 2, sum of overlapping time 177µs |
65 | . ' && !ref(' . $_[1] . ')' | ||||
66 | 1 | 10µs | 4 | 5µs | }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
67 | |||||
68 | subtype 'Ref' | ||||
69 | => as 'Defined' | ||||
70 | => where { ref($_) } | ||||
71 | # no need to call parent - ref also checks for definedness | ||||
72 | 2 | 16µs | 4 | 5µs | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:72] which was called:
# once (2µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as |
73 | |||||
74 | subtype 'Str' | ||||
75 | => as 'Value' | ||||
76 | => where { ref(\$_) eq 'SCALAR' || ref(\(my $val = $_)) eq 'SCALAR' } | ||||
77 | # spent 83µs (12+71) within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:83] which was called:
# once (12µs+71µs) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
78 | 1 | 8µs | 2 | 1µs | $_[0]->parent()->_inline_check($_[1]) # spent 1µs making 1 call to Moose::Meta::TypeConstraint::parent
# spent 70µs making 1 call to Moose::Meta::TypeConstraint::_inline_check, recursion: max depth 1, sum of overlapping time 70µs |
79 | . ' && (' | ||||
80 | . 'ref(\\' . $_[1] . ') eq "SCALAR"' | ||||
81 | . ' || ref(\\(my $val = ' . $_[1] . ')) eq "SCALAR"' | ||||
82 | . ')' | ||||
83 | 1 | 11µs | 4 | 5µs | }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
84 | |||||
85 | 1 | 1µs | 1 | 19µs | my $value_type = Moose::Util::TypeConstraints::find_type_constraint('Value'); # spent 19µs making 1 call to Moose::Util::TypeConstraints::find_type_constraint |
86 | subtype 'Num' | ||||
87 | => as 'Str' | ||||
88 | => where { | ||||
89 | my $val = $_; | ||||
90 | ($val =~ /\A[+-]?[0-9]+\z/) || | ||||
91 | ( $val =~ /\A(?:[+-]?) #matches optional +- in the beginning | ||||
92 | (?=[0-9]|\.[0-9]) #matches previous +- only if there is something like 3 or .3 | ||||
93 | [0-9]* #matches 0-9 zero or more times | ||||
94 | (?:\.[0-9]+)? #matches optional .89 or nothing | ||||
95 | (?:[Ee](?:[+-]?[0-9]+))? #matches E1 or e1 or e-1 or e+1 etc | ||||
96 | \z/x ); | ||||
97 | } | ||||
98 | # spent 68µs (9+60) within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:112] which was called:
# once (9µs+60µs) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
99 | # the long Str tests are redundant here | ||||
100 | #storing $_[1] in a temporary value, | ||||
101 | #so that $_[1] won't get converted to a string for regex match | ||||
102 | #see t/attributes/numeric_defaults.t for more details | ||||
103 | 1 | 7µs | 1 | 0s | 'my $val = '.$_[1].';'. # spent 60µs making 1 call to Moose::Meta::TypeConstraint::_inline_check, recursion: max depth 1, sum of overlapping time 60µs |
104 | $value_type->_inline_check('$val') | ||||
105 | .' && ( $val =~ /\A[+-]?[0-9]+\z/ || ' | ||||
106 | . '$val =~ /\A(?:[+-]?) #matches optional +- in the beginning | ||||
107 | (?=[0-9]|\.[0-9]) #matches previous +- only if there is something like 3 or .3 | ||||
108 | [0-9]* #matches 0-9 zero or more times | ||||
109 | (?:\.[0-9]+)? #matches optional .89 or nothing | ||||
110 | (?:[Ee](?:[+-]?[0-9]+))? #matches E1 or e1 or e-1 or e+1 etc | ||||
111 | \z/x ); ' | ||||
112 | 1 | 12µs | 4 | 6µs | }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as |
113 | |||||
114 | subtype 'Int' | ||||
115 | => as 'Num' | ||||
116 | => where { (my $val = $_) =~ /\A-?[0-9]+\z/ } | ||||
117 | # spent 224µs (19+205) within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:120] which was called 3 times, avg 75µs/call:
# 3 times (19µs+205µs) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 75µs/call | ||||
118 | 3 | 16µs | 3 | 0s | $value_type->_inline_check($_[1]) # spent 205µs making 3 calls to Moose::Meta::TypeConstraint::_inline_check, avg 68µs/call, recursion: max depth 1, sum of overlapping time 205µs |
119 | . ' && (my $val = ' . $_[1] . ') =~ /\A-?[0-9]+\z/' | ||||
120 | 1 | 10µs | 4 | 5µs | }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
121 | |||||
122 | subtype 'CodeRef' | ||||
123 | => as 'Ref' | ||||
124 | => where { ref($_) eq 'CODE' } | ||||
125 | 2 | 16µs | 4 | 5µs | # spent 3µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:125] which was called:
# once (3µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
126 | |||||
127 | subtype 'RegexpRef' | ||||
128 | => as 'Ref' | ||||
129 | => where( \&_RegexpRef ) | ||||
130 | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:132] which was called:
# once (2µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
131 | 1 | 6µs | 'Moose::Util::TypeConstraints::Builtins::_RegexpRef(' . $_[1] . ')' | ||
132 | 1 | 9µs | 4 | 5µs | }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as |
133 | |||||
134 | subtype 'GlobRef' | ||||
135 | => as 'Ref' | ||||
136 | => where { ref($_) eq 'GLOB' } | ||||
137 | 2 | 16µs | 4 | 5µs | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:137] which was called:
# once (2µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
138 | |||||
139 | # NOTE: scalar filehandles are GLOB refs, but a GLOB ref is not always a | ||||
140 | # filehandle | ||||
141 | subtype 'FileHandle' | ||||
142 | => as 'Ref' | ||||
143 | => where { | ||||
144 | (ref($_) eq "GLOB" && Scalar::Util::openhandle($_)) | ||||
145 | || (blessed($_) && $_->isa("IO::Handle")); | ||||
146 | } | ||||
147 | # spent 4µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:152] which was called:
# once (4µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
148 | 1 | 8µs | '(ref(' . $_[1] . ') eq "GLOB" ' | ||
149 | . '&& Scalar::Util::openhandle(' . $_[1] . ')) ' | ||||
150 | . '|| (Scalar::Util::blessed(' . $_[1] . ') ' | ||||
151 | . '&& ' . $_[1] . '->isa("IO::Handle"))' | ||||
152 | 1 | 12µs | 4 | 5µs | }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
153 | |||||
154 | subtype 'Object' | ||||
155 | => as 'Ref' | ||||
156 | => where { blessed($_) } | ||||
157 | 2 | 16µs | 4 | 5µs | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:157] which was called:
# once (2µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as |
158 | |||||
159 | subtype 'ClassName' | ||||
160 | => as 'Str' | ||||
161 | => where { is_class_loaded($_) } | ||||
162 | # the long Str tests are redundant here | ||||
163 | 3 | 23µs | 4 | 6µs | # spent 4µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:163] which was called 2 times, avg 2µs/call:
# 2 times (4µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 2µs/call # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
164 | |||||
165 | subtype 'RoleName' | ||||
166 | => as 'ClassName' | ||||
167 | => where { | ||||
168 | (Class::MOP::class_of($_) || return)->isa('Moose::Meta::Role'); | ||||
169 | } | ||||
170 | # spent 40µs (11+29) within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:176] which was called:
# once (11µs+29µs) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
171 | 1 | 7µs | 2 | 1µs | $_[0]->parent()->_inline_check($_[1]) # spent 1µs making 1 call to Moose::Meta::TypeConstraint::parent
# spent 28µs making 1 call to Moose::Meta::TypeConstraint::_inline_check, recursion: max depth 1, sum of overlapping time 28µs |
172 | . ' && do {' | ||||
173 | . 'my $meta = Class::MOP::class_of(' . $_[1] . ');' | ||||
174 | . '$meta && $meta->isa("Moose::Meta::Role");' | ||||
175 | . '}' | ||||
176 | 1 | 11µs | 4 | 5µs | }; # spent 2µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
177 | |||||
178 | $registry->add_type_constraint( | ||||
179 | Moose::Meta::TypeConstraint::Parameterizable->new( | ||||
180 | name => 'ScalarRef', | ||||
181 | package_defined_in => __PACKAGE__, | ||||
182 | parent => | ||||
183 | Moose::Util::TypeConstraints::find_type_constraint('Ref'), | ||||
184 | constraint => sub { ref($_) eq 'SCALAR' || ref($_) eq 'REF' }, | ||||
185 | constraint_generator => sub { | ||||
186 | my $type_parameter = shift; | ||||
187 | my $check = $type_parameter->_compiled_type_constraint; | ||||
188 | return sub { | ||||
189 | return $check->( ${$_} ); | ||||
190 | }; | ||||
191 | }, | ||||
192 | # spent 3µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:195] which was called:
# once (3µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
193 | 1 | 6µs | 'ref(' . $_[1] . ') eq "SCALAR" ' | ||
194 | . '|| ref(' . $_[1] . ') eq "REF"' | ||||
195 | }, | ||||
196 | inline_generator => sub { | ||||
197 | my $self = shift; | ||||
198 | my $type_parameter = shift; | ||||
199 | my $val = shift; | ||||
200 | '(ref(' . $val . ') eq "SCALAR" || ref(' . $val . ') eq "REF") ' | ||||
201 | . '&& ' . $type_parameter->_inline_check('${(' . $val . ')}') | ||||
202 | }, | ||||
203 | ) | ||||
204 | 1 | 15µs | 3 | 471µs | ); # spent 425µs making 1 call to Moose::Meta::TypeConstraint::new
# spent 24µs making 1 call to Moose::Meta::TypeConstraint::Registry::add_type_constraint
# spent 23µs making 1 call to Moose::Util::TypeConstraints::find_type_constraint |
205 | |||||
206 | $registry->add_type_constraint( | ||||
207 | Moose::Meta::TypeConstraint::Parameterizable->new( | ||||
208 | name => 'ArrayRef', | ||||
209 | package_defined_in => __PACKAGE__, | ||||
210 | parent => | ||||
211 | Moose::Util::TypeConstraints::find_type_constraint('Ref'), | ||||
212 | constraint => sub { ref($_) eq 'ARRAY' }, | ||||
213 | constraint_generator => sub { | ||||
214 | my $type_parameter = shift; | ||||
215 | my $check = $type_parameter->_compiled_type_constraint; | ||||
216 | return sub { | ||||
217 | foreach my $x (@$_) { | ||||
218 | ( $check->($x) ) || return; | ||||
219 | } | ||||
220 | 1; | ||||
221 | } | ||||
222 | }, | ||||
223 | 1 | 5µs | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:223] which was called:
# once (2µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||
224 | inline_generator => sub { | ||||
225 | my $self = shift; | ||||
226 | my $type_parameter = shift; | ||||
227 | my $val = shift; | ||||
228 | |||||
229 | 'do {' | ||||
230 | . 'my $check = ' . $val . ';' | ||||
231 | . 'ref($check) eq "ARRAY" ' | ||||
232 | . '&& &List::MoreUtils::all(' | ||||
233 | . 'sub { ' . $type_parameter->_inline_check('$_') . ' }, ' | ||||
234 | . '@{$check}' | ||||
235 | . ')' | ||||
236 | . '}'; | ||||
237 | }, | ||||
238 | ) | ||||
239 | 1 | 11µs | 3 | 314µs | ); # spent 276µs making 1 call to Moose::Meta::TypeConstraint::new
# spent 20µs making 1 call to Moose::Meta::TypeConstraint::Registry::add_type_constraint
# spent 18µs making 1 call to Moose::Util::TypeConstraints::find_type_constraint |
240 | |||||
241 | $registry->add_type_constraint( | ||||
242 | Moose::Meta::TypeConstraint::Parameterizable->new( | ||||
243 | name => 'HashRef', | ||||
244 | package_defined_in => __PACKAGE__, | ||||
245 | parent => | ||||
246 | Moose::Util::TypeConstraints::find_type_constraint('Ref'), | ||||
247 | constraint => sub { ref($_) eq 'HASH' }, | ||||
248 | constraint_generator => sub { | ||||
249 | my $type_parameter = shift; | ||||
250 | my $check = $type_parameter->_compiled_type_constraint; | ||||
251 | return sub { | ||||
252 | foreach my $x ( values %$_ ) { | ||||
253 | ( $check->($x) ) || return; | ||||
254 | } | ||||
255 | 1; | ||||
256 | } | ||||
257 | }, | ||||
258 | 1 | 5µs | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:258] which was called:
# once (2µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||
259 | inline_generator => sub { | ||||
260 | my $self = shift; | ||||
261 | my $type_parameter = shift; | ||||
262 | my $val = shift; | ||||
263 | |||||
264 | 'do {' | ||||
265 | . 'my $check = ' . $val . ';' | ||||
266 | . 'ref($check) eq "HASH" ' | ||||
267 | . '&& &List::MoreUtils::all(' | ||||
268 | . 'sub { ' . $type_parameter->_inline_check('$_') . ' }, ' | ||||
269 | . 'values %{$check}' | ||||
270 | . ')' | ||||
271 | . '}'; | ||||
272 | }, | ||||
273 | ) | ||||
274 | 1 | 10µs | 3 | 334µs | ); # spent 292µs making 1 call to Moose::Meta::TypeConstraint::new
# spent 24µs making 1 call to Moose::Meta::TypeConstraint::Registry::add_type_constraint
# spent 18µs making 1 call to Moose::Util::TypeConstraints::find_type_constraint |
275 | |||||
276 | $registry->add_type_constraint( | ||||
277 | Moose::Meta::TypeConstraint::Parameterizable->new( | ||||
278 | name => 'Maybe', | ||||
279 | package_defined_in => __PACKAGE__, | ||||
280 | parent => | ||||
281 | Moose::Util::TypeConstraints::find_type_constraint('Item'), | ||||
282 | constraint => sub {1}, | ||||
283 | constraint_generator => sub { | ||||
284 | my $type_parameter = shift; | ||||
285 | my $check = $type_parameter->_compiled_type_constraint; | ||||
286 | return sub { | ||||
287 | return 1 if not( defined($_) ) || $check->($_); | ||||
288 | return; | ||||
289 | } | ||||
290 | }, | ||||
291 | 1 | 4µs | # spent 1µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:291] which was called:
# once (1µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||
292 | inline_generator => sub { | ||||
293 | my $self = shift; | ||||
294 | my $type_parameter = shift; | ||||
295 | my $val = shift; | ||||
296 | '!defined(' . $val . ') ' | ||||
297 | . '|| (' . $type_parameter->_inline_check($val) . ')' | ||||
298 | }, | ||||
299 | ) | ||||
300 | 1 | 15µs | 3 | 300µs | ); # spent 262µs making 1 call to Moose::Meta::TypeConstraint::new
# spent 20µs making 1 call to Moose::Meta::TypeConstraint::Registry::add_type_constraint
# spent 18µs making 1 call to Moose::Util::TypeConstraints::find_type_constraint |
301 | } | ||||
302 | |||||
303 | 1 | 4µs | 1; | ||
304 | |||||
305 | __END__ |