Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm |
Statements | Executed 381528 statements in 914ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
76306 | 1 | 1 | 462ms | 599ms | __ANON__[:19] | Safe::Isa::
76306 | 8 | 5 | 239ms | 837ms | __ANON__[:23] | Safe::Isa::
1 | 1 | 1 | 24µs | 27µs | BEGIN@3 | Safe::Isa::
1 | 1 | 1 | 15µs | 29µs | BEGIN@6 | Safe::Isa::
1 | 1 | 1 | 6µs | 51µs | BEGIN@4 | Safe::Isa::
1 | 1 | 1 | 2µs | 2µs | BEGIN@5 | Safe::Isa::
0 | 0 | 0 | 0s | 0s | __ANON__[:30] | Safe::Isa::
0 | 0 | 0 | 0s | 0s | __ANON__[:35] | Safe::Isa::
0 | 0 | 0 | 0s | 0s | __ANON__[:43] | Safe::Isa::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Safe::Isa; | ||||
2 | |||||
3 | 2 | 30µs | 2 | 30µs | # spent 27µs (24+3) within Safe::Isa::BEGIN@3 which was called:
# once (24µs+3µs) by OpenAPI::Modern::BEGIN@19 at line 3 # spent 27µs making 1 call to Safe::Isa::BEGIN@3
# spent 3µs making 1 call to strict::import |
4 | 2 | 22µs | 2 | 96µs | # spent 51µs (6+45) within Safe::Isa::BEGIN@4 which was called:
# once (6µs+45µs) by OpenAPI::Modern::BEGIN@19 at line 4 # spent 51µs making 1 call to Safe::Isa::BEGIN@4
# spent 45µs making 1 call to warnings::import |
5 | 2 | 26µs | 1 | 2µs | # spent 2µs within Safe::Isa::BEGIN@5 which was called:
# once (2µs+0s) by OpenAPI::Modern::BEGIN@19 at line 5 # spent 2µs making 1 call to Safe::Isa::BEGIN@5 |
6 | 3 | 329µs | 3 | 43µs | # spent 29µs (15+14) within Safe::Isa::BEGIN@6 which was called:
# once (15µs+14µs) by OpenAPI::Modern::BEGIN@19 at line 6 # spent 29µs making 1 call to Safe::Isa::BEGIN@6
# spent 10µs making 1 call to UNIVERSAL::VERSION
# spent 4µs making 1 call to Exporter::import |
7 | |||||
8 | 1 | 0s | our $VERSION = '1.000010'; | ||
9 | |||||
10 | 1 | 1µs | our @EXPORT = qw($_call_if_object $_isa $_can $_does $_DOES $_call_if_can); | ||
11 | |||||
12 | # spent 599ms (462+137) within Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:19] which was called 76306 times, avg 8µs/call:
# 76306 times (462ms+137ms) by Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:23] at line 23, avg 8µs/call | ||||
13 | 76306 | 36.5ms | my ($obj, $method) = (shift, shift); | ||
14 | # This is intentionally a truth test, not a defined test, otherwise | ||||
15 | # we gratuitously break modules like Scalar::Defer, which would be | ||||
16 | # un-perlish. | ||||
17 | 76306 | 233ms | 76306 | 72.2ms | return unless Scalar::Util::blessed($obj); # spent 72.2ms making 76306 calls to Scalar::Util::blessed, avg 946ns/call |
18 | 76283 | 390ms | 76283 | 64.6ms | return $obj->$method(@_); # spent 64.6ms making 76283 calls to UNIVERSAL::isa, avg 847ns/call |
19 | 1 | 3µs | }; | ||
20 | |||||
21 | our ($_isa, $_can) = map { | ||||
22 | 3 | 4µs | my $method = $_; | ||
23 | 152612 | 255ms | 76306 | 599ms | # spent 837ms (239+599) within Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:23] which was called 76306 times, avg 11µs/call:
# 72037 times (223ms+559ms) by JSON::Schema::Modern::Annotation::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Annotation.pm:35] at line 35 of JSON/Schema/Modern/Annotation.pm, avg 11µs/call
# 4217 times (15.6ms+38.9ms) by JSON::Schema::Modern::Error::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Error.pm:39] at line 39 of JSON/Schema/Modern/Error.pm, avg 13µs/call
# 25 times (126µs+199µs) by JSON::Schema::Modern::Document::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Document.pm:39] at line 39 of JSON/Schema/Modern/Document.pm, avg 13µs/call
# 15 times (71µs+71µs) by JSON::Schema::Modern::Document::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Document.pm:45] at line 45 of JSON/Schema/Modern/Document.pm, avg 9µs/call
# 9 times (33µs+50µs) by JSON::Schema::Modern::add_schema at line 152 of JSON/Schema/Modern.pm, avg 9µs/call
# once (6µs+33µs) by JSON::Schema::Modern::add_schema at line 140 of JSON/Schema/Modern.pm
# once (4µs+12µs) by JSON::Schema::Modern::evaluate at line 317 of JSON/Schema/Modern.pm
# once (5µs+5µs) by JSON::Schema::Modern::Document::OpenAPI::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Document/OpenAPI.pm:56] at line 56 of JSON/Schema/Modern/Document/OpenAPI.pm # spent 599ms making 76306 calls to Safe::Isa::__ANON__[Safe/Isa.pm:19], avg 8µs/call |
24 | 2 | 2µs | } qw(isa can); | ||
25 | |||||
26 | our $_call_if_can = sub { | ||||
27 | my ($obj, $method) = (shift, shift); | ||||
28 | return unless $obj->$_call_if_object(can => $method); | ||||
29 | return $obj->$method(@_); | ||||
30 | 1 | 2µs | }; | ||
31 | |||||
32 | our $_does = sub { | ||||
33 | my $obj = shift; | ||||
34 | $obj->$_call_if_can(does => @_); | ||||
35 | 1 | 1µs | }; | ||
36 | |||||
37 | our $_DOES = sub { | ||||
38 | my $obj = shift; | ||||
39 | return unless Scalar::Util::blessed($obj); | ||||
40 | return $obj->DOES(@_) | ||||
41 | if $obj->can('DOES'); | ||||
42 | return $obj->isa(@_); | ||||
43 | 1 | 1µs | }; | ||
44 | |||||
45 | 1 | 11µs | 1; | ||
46 | __END__ |