Filename | /usr/lib/x86_64-linux-gnu/perl5/5.20/Class/XSAccessor/Heavy.pm |
Statements | Executed 15 statements in 400µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 14µs | 14µs | BEGIN@4 | Class::XSAccessor::Heavy::
1 | 1 | 1 | 10µs | 13µs | BEGIN@6 | Class::XSAccessor::Heavy::
1 | 1 | 1 | 8µs | 14µs | BEGIN@27 | Class::XSAccessor::Heavy::
1 | 1 | 1 | 8µs | 20µs | BEGIN@30 | Class::XSAccessor::Heavy::
1 | 1 | 1 | 7µs | 29µs | BEGIN@7 | Class::XSAccessor::Heavy::
1 | 1 | 1 | 7µs | 14µs | BEGIN@5 | Class::XSAccessor::Heavy::
0 | 0 | 0 | 0s | 0s | check_sub_existence | Class::XSAccessor::Heavy::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package # hide from PAUSE | ||||
2 | Class::XSAccessor::Heavy; | ||||
3 | |||||
4 | 2 | 38µs | 1 | 14µs | # spent 14µs within Class::XSAccessor::Heavy::BEGIN@4 which was called:
# once (14µs+0s) by Class::XSAccessor::BEGIN@6 at line 4 # spent 14µs making 1 call to Class::XSAccessor::Heavy::BEGIN@4 |
5 | 2 | 34µs | 2 | 20µs | # spent 14µs (7+6) within Class::XSAccessor::Heavy::BEGIN@5 which was called:
# once (7µs+6µs) by Class::XSAccessor::BEGIN@6 at line 5 # spent 14µs making 1 call to Class::XSAccessor::Heavy::BEGIN@5
# spent 6µs making 1 call to strict::import |
6 | 2 | 29µs | 2 | 17µs | # spent 13µs (10+4) within Class::XSAccessor::Heavy::BEGIN@6 which was called:
# once (10µs+4µs) by Class::XSAccessor::BEGIN@6 at line 6 # spent 13µs making 1 call to Class::XSAccessor::Heavy::BEGIN@6
# spent 4µs making 1 call to warnings::import |
7 | 2 | 128µs | 2 | 50µs | # spent 29µs (7+21) within Class::XSAccessor::Heavy::BEGIN@7 which was called:
# once (7µs+21µs) by Class::XSAccessor::BEGIN@6 at line 7 # spent 29µs making 1 call to Class::XSAccessor::Heavy::BEGIN@7
# spent 21µs making 1 call to Exporter::import |
8 | |||||
9 | 1 | 400ns | our $VERSION = '1.19'; | ||
10 | 1 | 800ns | our @CARP_NOT = qw( | ||
11 | Class::XSAccessor | ||||
12 | Class::XSAccessor::Array | ||||
13 | ); | ||||
14 | |||||
15 | # TODO Move more duplicated code from XSA and XSA::Array here | ||||
16 | |||||
17 | |||||
18 | sub check_sub_existence { | ||||
19 | my $subname = shift; | ||||
20 | |||||
21 | my $sub_package = $subname; | ||||
22 | $sub_package =~ s/([^:]+)$// or die; | ||||
23 | my $bare_subname = $1; | ||||
24 | |||||
25 | my $sym; | ||||
26 | { | ||||
27 | 2 | 43µs | 2 | 20µs | # spent 14µs (8+6) within Class::XSAccessor::Heavy::BEGIN@27 which was called:
# once (8µs+6µs) by Class::XSAccessor::BEGIN@6 at line 27 # spent 14µs making 1 call to Class::XSAccessor::Heavy::BEGIN@27
# spent 6µs making 1 call to strict::unimport |
28 | $sym = \%{"$sub_package"}; | ||||
29 | } | ||||
30 | 2 | 124µs | 2 | 33µs | # spent 20µs (8+12) within Class::XSAccessor::Heavy::BEGIN@30 which was called:
# once (8µs+12µs) by Class::XSAccessor::BEGIN@6 at line 30 # spent 20µs making 1 call to Class::XSAccessor::Heavy::BEGIN@30
# spent 12µs making 1 call to warnings::unimport |
31 | local *s = $sym->{$bare_subname}; | ||||
32 | my $coderef = *s{CODE}; | ||||
33 | if ($coderef) { | ||||
34 | $sub_package =~ s/::$//; | ||||
35 | Carp::croak("Cannot replace existing subroutine '$bare_subname' in package '$sub_package' with an XS implementation. If you wish to force a replacement, add the 'replace => 1' parameter to the arguments of 'use ".(caller())[0]."'."); | ||||
36 | } | ||||
37 | } | ||||
38 | |||||
39 | 1 | 3µs | 1; | ||
40 | |||||
41 | __END__ |