Profile of Class/XSAccessor/Heavy.pm

← Index
NYTProf Performance Profile «line view»
For t/optimization.t
Run on Thu Jan 8 22:47:42 2015
Reported on Thu Jan 8 22:48:05 2015

Filename | /home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/x86_64-linux/Class/XSAccessor/Heavy.pm
Statements | Executed 175 statements in 579µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
16 | 2 | 2 | 149µs | 216µs | Class::XSAccessor::Heavy::::check_sub_existenceClass::XSAccessor::Heavy::check_sub_existence
16 | 1 | 1 | 67µs | 67µs | Class::XSAccessor::Heavy::::CORE:substClass::XSAccessor::Heavy::CORE:subst (opcode)
1 | 1 | 1 | 17µs | 17µs | Class::XSAccessor::Heavy::::BEGIN@4Class::XSAccessor::Heavy::BEGIN@4
1 | 1 | 1 | 11µs | 26µs | Class::XSAccessor::Heavy::::BEGIN@30Class::XSAccessor::Heavy::BEGIN@30
1 | 1 | 1 | 10µs | 22µs | Class::XSAccessor::Heavy::::BEGIN@27Class::XSAccessor::Heavy::BEGIN@27
1 | 1 | 1 | 10µs | 14µs | Class::XSAccessor::Heavy::::BEGIN@6Class::XSAccessor::Heavy::BEGIN@6
1 | 1 | 1 | 9µs | 48µs | Class::XSAccessor::Heavy::::BEGIN@7Class::XSAccessor::Heavy::BEGIN@7
1 | 1 | 1 | 9µs | 24µs | Class::XSAccessor::Heavy::::BEGIN@5Class::XSAccessor::Heavy::BEGIN@5

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package # hide from PAUSE
2 |  |  |  |  | Class::XSAccessor::Heavy;
3 |  |  |  |  |
4 | 2 | 47µs | 1 | 17µs | # spent 17µs within Class::XSAccessor::Heavy::BEGIN@4 which was called: # once (17µs+0s) by Class::XSAccessor::BEGIN@6 at line 4 use 5.008; # spent 17µs making 1 call to Class::XSAccessor::Heavy::BEGIN@4
5 | 2 | 24µs | 2 | 39µs | # spent 24µs (9+15) within Class::XSAccessor::Heavy::BEGIN@5 which was called: # once (9µs+15µs) by Class::XSAccessor::BEGIN@6 at line 5 use strict; # spent 24µs making 1 call to Class::XSAccessor::Heavy::BEGIN@5 # spent 15µs making 1 call to strict::import
6 | 2 | 22µs | 2 | 18µs | # spent 14µ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 use warnings; # spent 14µs making 1 call to Class::XSAccessor::Heavy::BEGIN@6 # spent 4µs making 1 call to warnings::import
7 | 2 | 96µs | 2 | 87µs | # spent 48µs (9+39) within Class::XSAccessor::Heavy::BEGIN@7 which was called: # once (9µs+39µs) by Class::XSAccessor::BEGIN@6 at line 7 use Carp; # spent 48µs making 1 call to Class::XSAccessor::Heavy::BEGIN@7 # spent 39µs making 1 call to Exporter::import
8 |  |  |  |  |
9 | 1 | 700ns |  |  | our $VERSION = '1.14';
10 | 1 | 1µs |  |  | 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 |  |  |  |  | # spent 216µs (149+67) within Class::XSAccessor::Heavy::check_sub_existence which was called 16 times, avg 14µs/call: # 9 times (81µs+38µs) by Class::XSAccessor::_generate_method at line 79 of Class/XSAccessor.pm, avg 13µs/call # 7 times (68µs+29µs) by Class::XSAccessor::Array::_generate_method at line 61 of Class/XSAccessor/Array.pm, avg 14µs/call sub check_sub_existence {
19 | 16 | 6µs |  |  | my $subname = shift;
20 |  |  |  |  |
21 | 16 | 4µs |  |  | my $sub_package = $subname;
22 | 16 | 111µs | 16 | 67µs | $sub_package =~ s/([^:]+)$// or die; # spent 67µs making 16 calls to Class::XSAccessor::Heavy::CORE:subst, avg 4µs/call
23 | 16 | 16µs |  |  | my $bare_subname = $1;
24 |  |  |  |  |
25 | 16 | 2µs |  |  | my $sym;
26 |  |  |  |  | {
27 | 18 | 51µs | 2 | 35µs | # spent 22µs (10+12) within Class::XSAccessor::Heavy::BEGIN@27 which was called: # once (10µs+12µs) by Class::XSAccessor::BEGIN@6 at line 27 no strict 'refs'; # spent 22µs making 1 call to Class::XSAccessor::Heavy::BEGIN@27 # spent 12µs making 1 call to strict::unimport
28 | 16 | 23µs |  |  | $sym = \%{"$sub_package"};
29 |  |  |  |  | }
30 | 2 | 102µs | 2 | 40µs | # spent 26µs (11+14) within Class::XSAccessor::Heavy::BEGIN@30 which was called: # once (11µs+14µs) by Class::XSAccessor::BEGIN@6 at line 30 no warnings; # spent 26µs making 1 call to Class::XSAccessor::Heavy::BEGIN@30 # spent 14µs making 1 call to warnings::unimport
31 | 16 | 12µs |  |  | local *s = $sym->{$bare_subname};
32 | 16 | 7µs |  |  | my $coderef = *s{CODE};
33 | 16 | 48µs |  |  | 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 | 4µs |  |  | 1;
40 |  |  |  |  |
41 |  |  |  |  | __END__
|  |  |  |  | # spent 67µs within Class::XSAccessor::Heavy::CORE:subst which was called 16 times, avg 4µs/call: # 16 times (67µs+0s) by Class::XSAccessor::Heavy::check_sub_existence at line 22, avg 4µs/call sub Class::XSAccessor::Heavy::CORE:subst; # opcode