Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm |
Statements | Executed 21238 statements in 58.6ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
4248 | 1 | 1 | 28.6ms | 38.7ms | __ANON__[:19] | Safe::Isa::
4248 | 7 | 4 | 16.4ms | 55.1ms | __ANON__[:23] | Safe::Isa::
1 | 1 | 1 | 21µs | 23µs | BEGIN@3 | Safe::Isa::
1 | 1 | 1 | 10µs | 23µs | BEGIN@6 | Safe::Isa::
1 | 1 | 1 | 4µs | 34µ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 | 25µs | 2 | 25µs | # spent 23µs (21+2) within Safe::Isa::BEGIN@3 which was called:
# once (21µs+2µs) by OpenAPI::Modern::BEGIN@19 at line 3 # spent 23µs making 1 call to Safe::Isa::BEGIN@3
# spent 2µs making 1 call to strict::import |
4 | 2 | 13µs | 2 | 64µs | # spent 34µs (4+30) within Safe::Isa::BEGIN@4 which was called:
# once (4µs+30µs) by OpenAPI::Modern::BEGIN@19 at line 4 # spent 34µs making 1 call to Safe::Isa::BEGIN@4
# spent 30µs making 1 call to warnings::import |
5 | 2 | 17µ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 | 236µs | 3 | 36µs | # spent 23µs (10+13) within Safe::Isa::BEGIN@6 which was called:
# once (10µs+13µs) by OpenAPI::Modern::BEGIN@19 at line 6 # spent 23µs making 1 call to Safe::Isa::BEGIN@6
# spent 7µs making 1 call to UNIVERSAL::VERSION
# spent 6µ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 38.7ms (28.6+10.1) within Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:19] which was called 4248 times, avg 9µs/call:
# 4248 times (28.6ms+10.1ms) 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 | 4248 | 2.22ms | 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 | 4248 | 14.8ms | 4248 | 4.53ms | return unless Scalar::Util::blessed($obj); # spent 4.53ms making 4248 calls to Scalar::Util::blessed, avg 1µs/call |
18 | 4225 | 23.8ms | 4225 | 5.56ms | return $obj->$method(@_); # spent 5.56ms making 4225 calls to UNIVERSAL::isa, avg 1µs/call |
19 | 1 | 2µs | }; | ||
20 | |||||
21 | our ($_isa, $_can) = map { | ||||
22 | 3 | 2µs | my $method = $_; | ||
23 | 8496 | 17.5ms | 4248 | 38.7ms | # spent 55.1ms (16.4+38.7) within Safe::Isa::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Safe/Isa.pm:23] which was called 4248 times, avg 13µs/call:
# 4196 times (16.2ms+38.4ms) by JSON::Schema::Modern::Error::__ANON__[/Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Error.pm:39] at line 39 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Error.pm, avg 13µs/call
# 25 times (66µs+188µs) by JSON::Schema::Modern::Document::__ANON__[/Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Document.pm:39] at line 39 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Document.pm, avg 10µs/call
# 15 times (57µs+64µs) by JSON::Schema::Modern::Document::__ANON__[/Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Document.pm:45] at line 45 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Document.pm, avg 8µs/call
# 9 times (29µs+53µs) by JSON::Schema::Modern::add_schema at line 152 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 9µs/call
# once (4µs+59µs) by JSON::Schema::Modern::add_schema at line 140 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm
# once (3µ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
# once (2µs+6µs) by JSON::Schema::Modern::evaluate at line 321 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm # spent 38.7ms making 4248 calls to Safe::Isa::__ANON__[Safe/Isa.pm:19], avg 9µ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 | 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 | 0s | }; | ||
44 | |||||
45 | 1 | 4µs | 1; | ||
46 | __END__ |