Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm |
Statements | Executed 380293 statements in 1.01s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
76059 | 1 | 1 | 507ms | 657ms | __ANON__[:19] | Safe::Isa::
76059 | 8 | 5 | 256ms | 913ms | __ANON__[:23] | Safe::Isa::
1 | 1 | 1 | 21µs | 24µs | BEGIN@3 | Safe::Isa::
1 | 1 | 1 | 12µs | 24µs | BEGIN@6 | Safe::Isa::
1 | 1 | 1 | 5µs | 39µs | BEGIN@4 | Safe::Isa::
1 | 1 | 1 | 1µs | 1µ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 | 28µs | 2 | 27µs | # spent 24µs (21+3) within Safe::Isa::BEGIN@3 which was called:
# once (21µs+3µs) by OpenAPI::Modern::BEGIN@19 at line 3 # spent 24µs making 1 call to Safe::Isa::BEGIN@3
# spent 3µs making 1 call to strict::import |
4 | 2 | 17µs | 2 | 73µs | # spent 39µs (5+34) within Safe::Isa::BEGIN@4 which was called:
# once (5µs+34µs) by OpenAPI::Modern::BEGIN@19 at line 4 # spent 39µs making 1 call to Safe::Isa::BEGIN@4
# spent 34µs making 1 call to warnings::import |
5 | 2 | 18µs | 1 | 1µs | # spent 1µs within Safe::Isa::BEGIN@5 which was called:
# once (1µs+0s) by OpenAPI::Modern::BEGIN@19 at line 5 # spent 1µs making 1 call to Safe::Isa::BEGIN@5 |
6 | 3 | 361µs | 3 | 36µs | # spent 24µs (12+12) within Safe::Isa::BEGIN@6 which was called:
# once (12µs+12µs) by OpenAPI::Modern::BEGIN@19 at line 6 # spent 24µs making 1 call to Safe::Isa::BEGIN@6
# spent 7µs making 1 call to UNIVERSAL::VERSION
# spent 5µ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 657ms (507+150) within Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:19] which was called 76059 times, avg 9µs/call:
# 76059 times (507ms+150ms) by Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:23] at line 23, avg 9µs/call | ||||
13 | 76059 | 36.0ms | 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 | 76059 | 276ms | 76059 | 77.2ms | return unless Scalar::Util::blessed($obj); # spent 77.2ms making 76059 calls to Scalar::Util::blessed, avg 1µs/call |
18 | 76036 | 409ms | 76036 | 72.6ms | return $obj->$method(@_); # spent 72.6ms making 76036 calls to UNIVERSAL::isa, avg 954ns/call |
19 | 1 | 2µs | }; | ||
20 | |||||
21 | our ($_isa, $_can) = map { | ||||
22 | 3 | 2µs | my $method = $_; | ||
23 | 152118 | 293ms | 76059 | 657ms | # spent 913ms (256+657) within Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:23] which was called 76059 times, avg 12µs/call:
# 71790 times (240ms+615ms) 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 12µs/call
# 4217 times (15.9ms+41.3ms) 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 14µs/call
# 25 times (88µs+294µ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 15µs/call
# 15 times (93µs+81µ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 12µs/call
# 9 times (68µs+71µs) by JSON::Schema::Modern::add_schema at line 152 of JSON/Schema/Modern.pm, avg 15µs/call
# once (7µs+19µs) by JSON::Schema::Modern::add_schema at line 140 of JSON/Schema/Modern.pm
# once (4µs+8µs) by JSON::Schema::Modern::evaluate at line 317 of JSON/Schema/Modern.pm
# once (4µ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 657ms making 76059 calls to Safe::Isa::__ANON__[Safe/Isa.pm:19], avg 9µs/call |
24 | 2 | 1µ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 | 1µ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 | 5µs | 1; | ||
46 | __END__ |