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