Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm |
Statements | Executed 21343 statements in 70.4ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
4269 | 1 | 1 | 37.2ms | 49.2ms | __ANON__[:19] | Safe::Isa::
4269 | 7 | 4 | 19.3ms | 68.5ms | __ANON__[:23] | Safe::Isa::
1 | 1 | 1 | 53µs | 57µs | BEGIN@3 | Safe::Isa::
1 | 1 | 1 | 39µs | 39µs | BEGIN@5 | Safe::Isa::
1 | 1 | 1 | 19µs | 52µs | BEGIN@6 | Safe::Isa::
1 | 1 | 1 | 10µs | 63µs | BEGIN@4 | 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 | 49µs | 2 | 61µs | # spent 57µs (53+4) within Safe::Isa::BEGIN@3 which was called:
# once (53µs+4µs) by OpenAPI::Modern::BEGIN@19 at line 3 # spent 57µs making 1 call to Safe::Isa::BEGIN@3
# spent 4µs making 1 call to strict::import |
4 | 2 | 60µs | 2 | 116µs | # spent 63µs (10+53) within Safe::Isa::BEGIN@4 which was called:
# once (10µs+53µs) by OpenAPI::Modern::BEGIN@19 at line 4 # spent 63µs making 1 call to Safe::Isa::BEGIN@4
# spent 53µs making 1 call to warnings::import |
5 | 2 | 29µs | 1 | 39µs | # spent 39µs within Safe::Isa::BEGIN@5 which was called:
# once (39µs+0s) by OpenAPI::Modern::BEGIN@19 at line 5 # spent 39µs making 1 call to Safe::Isa::BEGIN@5 |
6 | 3 | 368µs | 3 | 85µs | # spent 52µs (19+33) within Safe::Isa::BEGIN@6 which was called:
# once (19µs+33µs) by OpenAPI::Modern::BEGIN@19 at line 6 # spent 52µs making 1 call to Safe::Isa::BEGIN@6
# spent 23µs making 1 call to Exporter::import
# spent 10µs making 1 call to UNIVERSAL::VERSION |
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 49.2ms (37.2+12.0) within Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:19] which was called 4269 times, avg 12µs/call:
# 4269 times (37.2ms+12.0ms) by Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:23] at line 23, avg 12µs/call | ||||
13 | 4269 | 2.99ms | 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 | 4269 | 19.0ms | 4269 | 5.83ms | return unless Scalar::Util::blessed($obj); # spent 5.83ms making 4269 calls to Scalar::Util::blessed, avg 1µs/call |
18 | 4246 | 30.4ms | 4246 | 6.21ms | return $obj->$method(@_); # spent 6.21ms making 4246 calls to UNIVERSAL::isa, avg 1µs/call |
19 | 1 | 3µs | }; | ||
20 | |||||
21 | our ($_isa, $_can) = map { | ||||
22 | 3 | 3µs | my $method = $_; | ||
23 | 8538 | 17.6ms | 4269 | 49.2ms | # spent 68.5ms (19.3+49.2) within Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:23] which was called 4269 times, avg 16µs/call:
# 4217 times (19.1ms+48.8ms) 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 16µs/call
# 25 times (84µs+224µ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 12µs/call
# 15 times (68µs+89µ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 10µs/call
# 9 times (38µs+54µs) by JSON::Schema::Modern::add_schema at line 152 of JSON/Schema/Modern.pm, avg 10µs/call
# once (4µs+14µs) by JSON::Schema::Modern::add_schema at line 140 of JSON/Schema/Modern.pm
# once (5µs+4µ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
# once (3µs+5µs) by JSON::Schema::Modern::evaluate at line 321 of JSON/Schema/Modern.pm # spent 49.2ms making 4269 calls to Safe::Isa::__ANON__[Safe/Isa.pm:19], avg 12µs/call |
24 | 2 | 3µ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 | 7µs | 1; | ||
46 | __END__ |