| Filename | /Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm |
| Statements | Executed 355 statements in 2.91ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 392µs | 6.53ms | Moose::Util::TypeConstraints::Builtins::define_builtins |
| 36 | 1 | 1 | 184µs | 926µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:66] |
| 16 | 1 | 1 | 72µs | 652µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:237] |
| 10 | 1 | 1 | 65µs | 524µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:83] |
| 13 | 1 | 1 | 49µs | 623µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:112] |
| 12 | 1 | 1 | 42µs | 574µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:120] |
| 37 | 1 | 1 | 42µs | 42µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:46] |
| 31 | 1 | 1 | 38µs | 38µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:223] |
| 16 | 16 | 1 | 19µs | 19µs | Moose::Util::TypeConstraints::Builtins::where |
| 13 | 1 | 1 | 18µs | 18µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:125] |
| 17 | 17 | 1 | 15µs | 15µs | Moose::Util::TypeConstraints::Builtins::inline_as |
| 5 | 1 | 1 | 15µs | 15µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:58] |
| 2 | 1 | 1 | 14µs | 17µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:222] |
| 16 | 16 | 1 | 14µs | 14µs | Moose::Util::TypeConstraints::Builtins::as |
| 16 | 16 | 1 | 13µs | 13µs | Moose::Util::TypeConstraints::Builtins::subtype |
| 1 | 1 | 1 | 9µs | 9µs | Moose::Util::TypeConstraints::Builtins::BEGIN@2 |
| 1 | 1 | 1 | 9µs | 29µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:176] |
| 1 | 1 | 1 | 8µs | 80µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:272] |
| 4 | 1 | 1 | 8µs | 8µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:195] |
| 1 | 1 | 1 | 8µs | 9µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:257] |
| 1 | 1 | 1 | 7µs | 29µs | Moose::Util::TypeConstraints::Builtins::BEGIN@12 |
| 1 | 1 | 1 | 6µs | 10µs | Moose::Util::TypeConstraints::Builtins::BEGIN@10 |
| 1 | 1 | 1 | 6µs | 34µs | Moose::Util::TypeConstraints::Builtins::BEGIN@14 |
| 1 | 1 | 1 | 6µs | 17µs | Moose::Util::TypeConstraints::Builtins::BEGIN@9 |
| 2 | 1 | 1 | 4µs | 4µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:157] |
| 1 | 1 | 1 | 3µs | 3µs | Moose::Util::TypeConstraints::Builtins::BEGIN@13 |
| 1 | 1 | 1 | 3µs | 3µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:152] |
| 2 | 1 | 1 | 3µs | 3µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:163] |
| 2 | 1 | 1 | 2µs | 2µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:28] |
| 1 | 1 | 1 | 2µs | 2µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:137] |
| 1 | 1 | 1 | 2µs | 2µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:258] |
| 1 | 1 | 1 | 1µs | 1µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:132] |
| 1 | 1 | 1 | 1µs | 1µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:39] |
| 1 | 1 | 1 | 1µs | 1µs | Moose::Util::TypeConstraints::Builtins::__ANON__[:72] |
| 1 | 1 | 1 | 1µs | 1µs | Moose::Util::TypeConstraints::Builtins::type |
| 1 | 1 | 1 | 900ns | 900ns | Moose::Util::TypeConstraints::Builtins::__ANON__[:291] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:116] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:124] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:136] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:146] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:156] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:161] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:169] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:184] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:190] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:191] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:202] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:212] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:221] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:247] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:256] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:27] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:282] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:289] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:290] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:298] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:32] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:36] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:43] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:50] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:62] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:70] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:76] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::__ANON__[:97] |
| 0 | 0 | 0 | 0s | 0s | Moose::Util::TypeConstraints::Builtins::optimize_as |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Util::TypeConstraints::Builtins; | ||||
| 2 | # spent 9µs within Moose::Util::TypeConstraints::Builtins::BEGIN@2 which was called:
# once (9µs+0s) by Moose::Meta::Attribute::BEGIN@24 at line 4 | ||||
| 3 | 1 | 4µs | $Moose::Util::TypeConstraints::Builtins::AUTHORITY = 'cpan:STEVAN'; | ||
| 4 | 1 | 34µs | 1 | 9µs | } # spent 9µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@2 |
| 5 | { | ||||
| 6 | 2 | 900ns | $Moose::Util::TypeConstraints::Builtins::VERSION = '2.1005'; | ||
| 7 | } | ||||
| 8 | |||||
| 9 | 2 | 22µs | 2 | 28µs | # spent 17µs (6+11) within Moose::Util::TypeConstraints::Builtins::BEGIN@9 which was called:
# once (6µs+11µs) by Moose::Meta::Attribute::BEGIN@24 at line 9 # spent 17µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@9
# spent 11µs making 1 call to strict::import |
| 10 | 2 | 22µs | 2 | 14µs | # spent 10µs (6+4) within Moose::Util::TypeConstraints::Builtins::BEGIN@10 which was called:
# once (6µs+4µs) by Moose::Meta::Attribute::BEGIN@24 at line 10 # spent 10µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@10
# spent 4µs making 1 call to warnings::import |
| 11 | |||||
| 12 | 2 | 21µs | 2 | 51µs | # spent 29µs (7+22) within Moose::Util::TypeConstraints::Builtins::BEGIN@12 which was called:
# once (7µs+22µs) by Moose::Meta::Attribute::BEGIN@24 at line 12 # spent 29µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@12
# spent 22µs making 1 call to Exporter::import |
| 13 | 2 | 26µs | 1 | 3µs | # spent 3µs within Moose::Util::TypeConstraints::Builtins::BEGIN@13 which was called:
# once (3µs+0s) by Moose::Meta::Attribute::BEGIN@24 at line 13 # spent 3µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@13 |
| 14 | 2 | 1.83ms | 2 | 61µs | # spent 34µs (6+27) within Moose::Util::TypeConstraints::Builtins::BEGIN@14 which was called:
# once (6µs+27µs) by Moose::Meta::Attribute::BEGIN@24 at line 14 # spent 34µs making 1 call to Moose::Util::TypeConstraints::Builtins::BEGIN@14
# spent 27µs making 1 call to Exporter::import |
| 15 | |||||
| 16 | 1 | 3µs | 1 | 310µs | # spent 1µs within Moose::Util::TypeConstraints::Builtins::type which was called:
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 28 # spent 310µs making 1 call to Moose::Util::TypeConstraints::type |
| 17 | 16 | 45µs | 16 | 4.77ms | # spent 13µs within Moose::Util::TypeConstraints::Builtins::subtype which was called 16 times, avg 812ns/call:
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 46
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 32
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 112
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 163
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 72
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 125
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 39
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 120
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 58
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 132
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 157
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 137
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 152
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 176
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 83
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 66 # spent 4.77ms making 16 calls to Moose::Util::TypeConstraints::subtype, avg 298µs/call |
| 18 | 16 | 45µs | 16 | 23µs | # spent 14µs within Moose::Util::TypeConstraints::Builtins::as which was called 16 times, avg 862ns/call:
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 176
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 152
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 32
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 120
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 39
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 72
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 112
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 46
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 132
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 58
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 66
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 83
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 163
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 125
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 137
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 157 # spent 23µs making 16 calls to Moose::Util::TypeConstraints::as, avg 1µs/call |
| 19 | 16 | 60µs | 16 | 19µs | # spent 19µs within Moose::Util::TypeConstraints::Builtins::where which was called 16 times, avg 1µs/call:
# once (2µ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 39
# 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 125
# 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 137
# 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 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 83
# 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 163
# 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 58
# 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 # spent 19µs making 16 calls to Moose::Util::TypeConstraints::where, avg 1µs/call |
| 20 | sub optimize_as (&) { goto &Moose::Util::TypeConstraints::optimize_as } | ||||
| 21 | 17 | 50µs | 17 | 17µs | # spent 15µs within Moose::Util::TypeConstraints::Builtins::inline_as which was called 17 times, avg 888ns/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 39
# once (1µs+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 28
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 120
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 112
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 125
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 137
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 157
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 46
# once (900ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 176
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 72
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 163
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 58
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 132
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 83
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 66
# once (800ns+0s) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 152 # spent 17µs making 17 calls to Moose::Util::TypeConstraints::inline_as, avg 1µs/call |
| 22 | |||||
| 23 | # spent 6.53ms (392µs+6.14) within Moose::Util::TypeConstraints::Builtins::define_builtins which was called:
# once (392µs+6.14ms) by Moose::Meta::Attribute::BEGIN@24 at line 727 of Moose/Util/TypeConstraints.pm | ||||
| 24 | 1 | 300ns | my $registry = shift; | ||
| 25 | |||||
| 26 | type 'Any' # meta-type including all | ||||
| 27 | => where {1} | ||||
| 28 | 3 | 11µs | 3 | 4µs | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:28] which was called 2 times, avg 950ns/call:
# 2 times (2µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 950ns/call # 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::type |
| 29 | |||||
| 30 | subtype 'Item' # base type | ||||
| 31 | => as 'Any' | ||||
| 32 | 1 | 6µs | 3 | 3µs | => inline_as { '1' }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 33 | |||||
| 34 | subtype 'Undef' | ||||
| 35 | => as 'Item' | ||||
| 36 | => where { !defined($_) } | ||||
| 37 | # spent 1µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:39] which was called:
# once (1µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
| 38 | 1 | 3µs | '!defined(' . $_[1] . ')' | ||
| 39 | 1 | 8µs | 4 | 4µs | }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 40 | |||||
| 41 | subtype 'Defined' | ||||
| 42 | => as 'Item' | ||||
| 43 | => where { defined($_) } | ||||
| 44 | # spent 42µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:46] which was called 37 times, avg 1µs/call:
# 37 times (42µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 1µs/call | ||||
| 45 | 37 | 72µs | 'defined(' . $_[1] . ')' | ||
| 46 | 1 | 7µs | 4 | 4µs | }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 47 | |||||
| 48 | subtype 'Bool' | ||||
| 49 | => as 'Item' | ||||
| 50 | => where { !defined($_) || $_ eq "" || "$_" eq '1' || "$_" eq '0' } | ||||
| 51 | # spent 15µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:58] which was called 5 times, avg 3µs/call:
# 5 times (15µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 3µs/call | ||||
| 52 | 5 | 19µs | '(' | ||
| 53 | . '!defined(' . $_[1] . ') ' | ||||
| 54 | . '|| ' . $_[1] . ' eq "" ' | ||||
| 55 | . '|| (' . $_[1] . '."") eq "1" ' | ||||
| 56 | . '|| (' . $_[1] . '."") eq "0"' | ||||
| 57 | . ')' | ||||
| 58 | 1 | 8µs | 4 | 4µs | }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 59 | |||||
| 60 | subtype 'Value' | ||||
| 61 | => as 'Defined' | ||||
| 62 | => where { !ref($_) } | ||||
| 63 | # spent 926µs (184+743) within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:66] which was called 36 times, avg 26µs/call:
# 36 times (184µs+743µs) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 26µs/call | ||||
| 64 | 36 | 117µs | 72 | 31µs | $_[0]->parent()->_inline_check($_[1]) # spent 31µs making 36 calls to Moose::Meta::TypeConstraint::parent, avg 861ns/call
# spent 712µs making 36 calls to Moose::Meta::TypeConstraint::_inline_check, avg 20µs/call, recursion: max depth 2, sum of overlapping time 712µs |
| 65 | . ' && !ref(' . $_[1] . ')' | ||||
| 66 | 1 | 7µs | 4 | 4µs | }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns 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 | 10µs | 4 | 4µs | # spent 1µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:72] which was called:
# once (1µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 73 | |||||
| 74 | subtype 'Str' | ||||
| 75 | => as 'Value' | ||||
| 76 | => where { ref(\$_) eq 'SCALAR' || ref(\(my $val = $_)) eq 'SCALAR' } | ||||
| 77 | # spent 524µs (65+459) within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:83] which was called 10 times, avg 52µs/call:
# 10 times (65µs+459µs) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 52µs/call | ||||
| 78 | 10 | 46µs | 20 | 10µs | $_[0]->parent()->_inline_check($_[1]) # spent 10µs making 10 calls to Moose::Meta::TypeConstraint::parent, avg 1µs/call
# spent 449µs making 10 calls to Moose::Meta::TypeConstraint::_inline_check, avg 45µs/call, recursion: max depth 1, sum of overlapping time 449µs |
| 79 | . ' && (' | ||||
| 80 | . 'ref(\\' . $_[1] . ') eq "SCALAR"' | ||||
| 81 | . ' || ref(\\(my $val = ' . $_[1] . ')) eq "SCALAR"' | ||||
| 82 | . ')' | ||||
| 83 | 1 | 8µs | 4 | 4µs | }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 84 | |||||
| 85 | 1 | 1µs | 1 | 13µs | my $value_type = Moose::Util::TypeConstraints::find_type_constraint('Value'); # spent 13µ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 623µs (49+574) within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:112] which was called 13 times, avg 48µs/call:
# 13 times (49µs+574µs) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 48µs/call | ||||
| 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 | 13 | 49µs | 13 | 0s | 'my $val = '.$_[1].';'. # spent 574µs making 13 calls to Moose::Meta::TypeConstraint::_inline_check, avg 44µs/call, recursion: max depth 1, sum of overlapping time 574µ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 | 7µs | 4 | 4µs | }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 113 | |||||
| 114 | subtype 'Int' | ||||
| 115 | => as 'Num' | ||||
| 116 | => where { (my $val = $_) =~ /\A-?[0-9]+\z/ } | ||||
| 117 | # spent 574µs (42+532) within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:120] which was called 12 times, avg 48µs/call:
# 12 times (42µs+532µs) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 48µs/call | ||||
| 118 | 12 | 35µs | 12 | 0s | $value_type->_inline_check($_[1]) # spent 532µs making 12 calls to Moose::Meta::TypeConstraint::_inline_check, avg 44µs/call, recursion: max depth 1, sum of overlapping time 532µs |
| 119 | . ' && (my $val = ' . $_[1] . ') =~ /\A-?[0-9]+\z/' | ||||
| 120 | 1 | 7µs | 4 | 4µs | }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 121 | |||||
| 122 | subtype 'CodeRef' | ||||
| 123 | => as 'Ref' | ||||
| 124 | => where { ref($_) eq 'CODE' } | ||||
| 125 | 14 | 37µs | 4 | 4µs | # spent 18µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:125] which was called 13 times, avg 1µs/call:
# 13 times (18µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 1µs/call # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 126 | |||||
| 127 | subtype 'RegexpRef' | ||||
| 128 | => as 'Ref' | ||||
| 129 | => where( \&_RegexpRef ) | ||||
| 130 | # spent 1µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:132] which was called:
# once (1µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
| 131 | 1 | 3µs | 'Moose::Util::TypeConstraints::Builtins::_RegexpRef(' . $_[1] . ')' | ||
| 132 | 1 | 6µs | 4 | 4µs | }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 133 | |||||
| 134 | subtype 'GlobRef' | ||||
| 135 | => as 'Ref' | ||||
| 136 | => where { ref($_) eq 'GLOB' } | ||||
| 137 | 2 | 16µs | 4 | 4µs | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/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 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns 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 3µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:152] which was called:
# once (3µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
| 148 | 1 | 5µs | '(ref(' . $_[1] . ') eq "GLOB" ' | ||
| 149 | . '&& Scalar::Util::openhandle(' . $_[1] . ')) ' | ||||
| 150 | . '|| (Scalar::Util::blessed(' . $_[1] . ') ' | ||||
| 151 | . '&& ' . $_[1] . '->isa("IO::Handle"))' | ||||
| 152 | 1 | 8µs | 4 | 4µs | }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 153 | |||||
| 154 | subtype 'Object' | ||||
| 155 | => as 'Ref' | ||||
| 156 | => where { blessed($_) } | ||||
| 157 | 3 | 13µs | 4 | 4µs | # spent 4µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:157] 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 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::subtype |
| 158 | |||||
| 159 | subtype 'ClassName' | ||||
| 160 | => as 'Str' | ||||
| 161 | => where { is_class_loaded($_) } | ||||
| 162 | # the long Str tests are redundant here | ||||
| 163 | 3 | 12µs | 4 | 4µs | # spent 3µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:163] which was called 2 times, avg 1µs/call:
# 2 times (3µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 1µs/call # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 800ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns 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 29µs (9+21) within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:176] which was called:
# once (9µs+21µs) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm | ||||
| 171 | 1 | 5µs | 2 | 900ns | $_[0]->parent()->_inline_check($_[1]) # spent 900ns making 1 call to Moose::Meta::TypeConstraint::parent
# spent 20µs making 1 call to Moose::Meta::TypeConstraint::_inline_check, recursion: max depth 1, sum of overlapping time 20µs |
| 172 | . ' && do {' | ||||
| 173 | . 'my $meta = Class::MOP::class_of(' . $_[1] . ');' | ||||
| 174 | . '$meta && $meta->isa("Moose::Meta::Role");' | ||||
| 175 | . '}' | ||||
| 176 | 1 | 7µs | 4 | 4µs | }; # spent 1µs making 1 call to Moose::Util::TypeConstraints::Builtins::where
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::as
# spent 900ns making 1 call to Moose::Util::TypeConstraints::Builtins::inline_as
# spent 800ns 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 8µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:195] which was called 4 times, avg 2µs/call:
# 4 times (8µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 2µs/call | ||||
| 193 | 4 | 12µ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 | 10µs | 3 | 301µs | ); # spent 272µs making 1 call to Moose::Meta::TypeConstraint::new
# spent 16µs making 1 call to Moose::Meta::TypeConstraint::Registry::add_type_constraint
# spent 13µ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 | # spent 17µs (14+2) within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:222] which was called 2 times, avg 8µs/call:
# 2 times (14µs+2µs) by Moose::Meta::TypeConstraint::Parameterizable::generate_constraint_for at line 36 of Moose/Meta/TypeConstraint/Parameterizable.pm, avg 8µs/call | ||||
| 214 | 2 | 400ns | my $type_parameter = shift; | ||
| 215 | 2 | 2µs | 2 | 2µs | my $check = $type_parameter->_compiled_type_constraint; # spent 2µs making 2 calls to Moose::Meta::TypeConstraint::_compiled_type_constraint, avg 1µs/call |
| 216 | return sub { | ||||
| 217 | foreach my $x (@$_) { | ||||
| 218 | ( $check->($x) ) || return; | ||||
| 219 | } | ||||
| 220 | 1; | ||||
| 221 | } | ||||
| 222 | 2 | 9µs | }, | ||
| 223 | 31 | 64µs | # spent 38µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:223] which was called 31 times, avg 1µs/call:
# 31 times (38µs+0s) by Moose::Meta::TypeConstraint::_inline_check at line 216 of Moose/Meta/TypeConstraint.pm, avg 1µs/call | ||
| 224 | # spent 652µs (72+579) within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:237] which was called 16 times, avg 41µs/call:
# 16 times (72µs+579µs) by Moose::Meta::TypeConstraint::Parameterizable::generate_inline_for at line 63 of Moose/Meta/TypeConstraint/Parameterizable.pm, avg 41µs/call | ||||
| 225 | 16 | 2µs | my $self = shift; | ||
| 226 | 16 | 200ns | my $type_parameter = shift; | ||
| 227 | 16 | 2µs | my $val = shift; | ||
| 228 | |||||
| 229 | 16 | 54µs | 16 | 579µs | 'do {' # spent 579µs making 16 calls to Moose::Meta::TypeConstraint::_inline_check, avg 36µs/call |
| 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 | 7µs | 3 | 210µs | ); # spent 183µs making 1 call to Moose::Meta::TypeConstraint::new
# spent 14µs making 1 call to Moose::Meta::TypeConstraint::Registry::add_type_constraint
# spent 13µ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 | # spent 9µs (8+1) within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:257] which was called:
# once (8µs+1µs) by Moose::Meta::TypeConstraint::Parameterizable::generate_constraint_for at line 36 of Moose/Meta/TypeConstraint/Parameterizable.pm | ||||
| 249 | 1 | 300ns | my $type_parameter = shift; | ||
| 250 | 1 | 1µs | 1 | 1µs | my $check = $type_parameter->_compiled_type_constraint; # spent 1µs making 1 call to Moose::Meta::TypeConstraint::_compiled_type_constraint |
| 251 | return sub { | ||||
| 252 | foreach my $x ( values %$_ ) { | ||||
| 253 | ( $check->($x) ) || return; | ||||
| 254 | } | ||||
| 255 | 1; | ||||
| 256 | } | ||||
| 257 | 1 | 5µs | }, | ||
| 258 | 1 | 4µs | # spent 2µs within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/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 | # spent 80µs (8+72) within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:272] which was called:
# once (8µs+72µs) by Moose::Meta::TypeConstraint::Parameterizable::generate_inline_for at line 63 of Moose/Meta/TypeConstraint/Parameterizable.pm | ||||
| 260 | 1 | 200ns | my $self = shift; | ||
| 261 | 1 | 200ns | my $type_parameter = shift; | ||
| 262 | 1 | 400ns | my $val = shift; | ||
| 263 | |||||
| 264 | 1 | 7µs | 1 | 72µs | 'do {' # spent 72µs making 1 call to Moose::Meta::TypeConstraint::_inline_check |
| 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 | 7µs | 3 | 211µs | ); # spent 184µs making 1 call to Moose::Meta::TypeConstraint::new
# spent 14µs making 1 call to Moose::Meta::TypeConstraint::Registry::add_type_constraint
# spent 13µ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 | 5µs | # spent 900ns within Moose::Util::TypeConstraints::Builtins::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Util/TypeConstraints/Builtins.pm:291] which was called:
# once (900ns+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 | 12µs | 3 | 205µs | ); # spent 178µs making 1 call to Moose::Meta::TypeConstraint::new
# spent 14µs making 1 call to Moose::Meta::TypeConstraint::Registry::add_type_constraint
# spent 13µs making 1 call to Moose::Util::TypeConstraints::find_type_constraint |
| 301 | } | ||||
| 302 | |||||
| 303 | 1 | 3µs | 1; | ||
| 304 | |||||
| 305 | __END__ |