← Index
NYTProf Performance Profile   « line view »
For starman worker -M FindBin --max-requests 50 --workers 2 --user=kohadev-koha --group kohadev-koha --pid /var/run/koha/kohadev/plack.pid --daemonize --access-log /var/log/koha/kohadev/plack.log --error-log /var/log/koha/kohadev/plack-error.log -E deployment --socket /var/run/koha/kohadev/plack.sock /etc/koha/sites/kohadev/plack.psgi
  Run on Fri Jan 8 14:16:49 2016
Reported on Fri Jan 8 14:23:07 2016

Filename/usr/lib/x86_64-linux-gnu/perl5/5.20/Class/XSAccessor.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
28221.50ms2.41msClass::XSAccessor::::importClass::XSAccessor::import
111412µs527µsClass::XSAccessor::::BEGIN@6Class::XSAccessor::BEGIN@6
2811362µs640µsClass::XSAccessor::::_generate_methodClass::XSAccessor::_generate_method
22481267µs267µsClass::XSAccessor::::_make_hashClass::XSAccessor::_make_hash
2411213µs213µsClass::XSAccessor::::newxs_accessorClass::XSAccessor::newxs_accessor (xsub)
281146µs46µsClass::XSAccessor::::CORE:matchClass::XSAccessor::CORE:match (opcode)
11124µs24µsClass::XSAccessor::::BEGIN@2Class::XSAccessor::BEGIN@2
41120µs20µsClass::XSAccessor::::newxs_getterClass::XSAccessor::newxs_getter (xsub)
11116µs26µsClass::XSAccessor::::BEGIN@3Class::XSAccessor::BEGIN@3
1118µs39µsClass::XSAccessor::::BEGIN@5Class::XSAccessor::BEGIN@5
1118µs15µsClass::XSAccessor::::BEGIN@4Class::XSAccessor::BEGIN@4
1118µs19µsClass::XSAccessor::::BEGIN@84Class::XSAccessor::BEGIN@84
1117µs7µsClass::XSAccessor::::BEGIN@7Class::XSAccessor::BEGIN@7
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Class::XSAccessor;
2124µs
# spent 24µs within Class::XSAccessor::BEGIN@2 which was called: # once (24µs+0s) by Module::Runtime::require_module at line 2
use 5.008;
# spent 24µs making 1 call to Class::XSAccessor::BEGIN@2
3236µs
# spent 26µs (16+10) within Class::XSAccessor::BEGIN@3 which was called: # once (16µs+10µs) by Module::Runtime::require_module at line 3
use strict;
# spent 26µs making 1 call to Class::XSAccessor::BEGIN@3 # spent 10µs making 1 call to strict::import
4222µs
# spent 15µs (8+7) within Class::XSAccessor::BEGIN@4 which was called: # once (8µs+7µs) by Module::Runtime::require_module at line 4
use warnings;
# spent 15µs making 1 call to Class::XSAccessor::BEGIN@4 # spent 7µs making 1 call to warnings::import
5270µs
# spent 39µs (8+31) within Class::XSAccessor::BEGIN@5 which was called: # once (8µs+31µs) by Module::Runtime::require_module at line 5
use Carp qw/croak/;
# spent 39µs making 1 call to Class::XSAccessor::BEGIN@5 # spent 31µs making 1 call to Exporter::import
61527µs
# spent 527µs (412+114) within Class::XSAccessor::BEGIN@6 which was called: # once (412µs+114µs) by Module::Runtime::require_module at line 6
use Class::XSAccessor::Heavy;
# spent 527µs making 1 call to Class::XSAccessor::BEGIN@6
717µs
# spent 7µs within Class::XSAccessor::BEGIN@7 which was called: # once (7µs+0s) by Module::Runtime::require_module at line 7
use XSLoader;
# spent 7µs making 1 call to Class::XSAccessor::BEGIN@7
8
9our $VERSION = '1.19';
10
111279µsXSLoader::load('Class::XSAccessor', $VERSION);
# spent 279µs making 1 call to XSLoader::load
12
13
# spent 267µs within Class::XSAccessor::_make_hash which was called 224 times, avg 1µs/call: # 28 times (71µs+0s) by Class::XSAccessor::import at line 37, avg 3µs/call # 28 times (32µs+0s) by Class::XSAccessor::import at line 38, avg 1µs/call # 28 times (29µs+0s) by Class::XSAccessor::import at line 41, avg 1µs/call # 28 times (28µs+0s) by Class::XSAccessor::import at line 40, avg 986ns/call # 28 times (27µs+0s) by Class::XSAccessor::import at line 43, avg 971ns/call # 28 times (27µs+0s) by Class::XSAccessor::import at line 39, avg 964ns/call # 28 times (27µs+0s) by Class::XSAccessor::import at line 44, avg 961ns/call # 28 times (26µs+0s) by Class::XSAccessor::import at line 42, avg 946ns/call
sub _make_hash {
14 my $ref = shift;
15
16 if (ref ($ref)) {
17 if (ref($ref) eq 'ARRAY') {
18 $ref = { map { $_ => $_ } @$ref }
19 }
20 } else {
21 $ref = { $ref, $ref };
22 }
23
24 return $ref;
25}
26
27
# spent 2.41ms (1.50+908µs) within Class::XSAccessor::import which was called 28 times, avg 86µs/call: # 24 times (1.32ms+818µs) by DBIx::Class::ResultSet::_result_class or DBIx::Class::ResultSet::result_source or DBIx::Class::ResultSource::_columns or DBIx::Class::ResultSource::_ordered_columns or DBIx::Class::ResultSource::_primaries or DBIx::Class::ResultSource::_relationships or DBIx::Class::ResultSource::_unique_constraints or DBIx::Class::ResultSource::name or DBIx::Class::ResultSource::source_name or DBIx::Class::Storage::DBI::_conn_pid or DBIx::Class::Storage::DBI::_connect_info or DBIx::Class::Storage::DBI::_dbh or DBIx::Class::Storage::DBI::_dbh_autocommit or DBIx::Class::Storage::DBI::_dbh_details or DBIx::Class::Storage::DBI::_dbic_connect_attributes or DBIx::Class::Storage::DBI::_driver_determined or DBIx::Class::Storage::DBI::_sql_maker or DBIx::Class::Storage::DBI::_sql_maker_opts or DBIx::Class::Storage::DBI::on_connect_call or DBIx::Class::Storage::DBI::on_connect_do or DBIx::Class::Storage::DBI::unsafe or DBIx::Class::Storage::debug or DBIx::Class::Storage::schema or DBIx::Class::Storage::transaction_depth at line 830 of Class/Accessor/Grouped.pm, avg 89µs/call # 4 times (180µs+89µs) by Method::Generate::Accessor::_generate_xs at line 641 of Method/Generate/Accessor.pm, avg 67µs/call
sub import {
28 my $own_class = shift;
29 my ($caller_pkg) = caller();
30
31 # Support both { getters => ... } and plain getters => ...
32 my %opts = ref($_[0]) eq 'HASH' ? %{$_[0]} : @_;
33
34 $caller_pkg = $opts{class} if defined $opts{class};
35
36 # TODO: Refactor. Move more duplicated code to ::Heavy
372871µs my $read_subs = _make_hash($opts{getters} || {});
# spent 71µs making 28 calls to Class::XSAccessor::_make_hash, avg 3µs/call
382832µs my $set_subs = _make_hash($opts{setters} || {});
# spent 32µs making 28 calls to Class::XSAccessor::_make_hash, avg 1µs/call
392827µs my $acc_subs = _make_hash($opts{accessors} || {});
# spent 27µs making 28 calls to Class::XSAccessor::_make_hash, avg 964ns/call
402828µs my $lvacc_subs = _make_hash($opts{lvalue_accessors} || {});
# spent 28µs making 28 calls to Class::XSAccessor::_make_hash, avg 986ns/call
412829µs my $pred_subs = _make_hash($opts{predicates} || {});
# spent 29µs making 28 calls to Class::XSAccessor::_make_hash, avg 1µs/call
422826µs my $ex_pred_subs = _make_hash($opts{exists_predicates} || {});
# spent 26µs making 28 calls to Class::XSAccessor::_make_hash, avg 946ns/call
432827µs my $def_pred_subs = _make_hash($opts{defined_predicates} || {});
# spent 27µs making 28 calls to Class::XSAccessor::_make_hash, avg 971ns/call
442827µs my $test_subs = _make_hash($opts{__tests__} || {});
# spent 27µs making 28 calls to Class::XSAccessor::_make_hash, avg 961ns/call
45 my $construct_subs = $opts{constructors} || [defined($opts{constructor}) ? $opts{constructor} : ()];
46 my $true_subs = $opts{true} || [];
47 my $false_subs = $opts{false} || [];
48
49 foreach my $subtype ( ["getter", $read_subs],
50 ["setter", $set_subs],
51 ["accessor", $acc_subs],
52 ["lvalue_accessor", $lvacc_subs],
53 ["test", $test_subs],
54 ["ex_predicate", $ex_pred_subs],
55 ["def_predicate", $def_pred_subs],
56 ["def_predicate", $pred_subs] )
57 {
58 my $subs = $subtype->[1];
59 foreach my $subname (keys %$subs) {
60 my $hashkey = $subs->{$subname};
6128640µs _generate_method($caller_pkg, $subname, $hashkey, \%opts, $subtype->[0]);
# spent 640µs making 28 calls to Class::XSAccessor::_generate_method, avg 23µs/call
62 }
63 }
64
65 foreach my $subtype ( ["constructor", $construct_subs],
66 ["true", $true_subs],
67 ["false", $false_subs] )
68 {
69 foreach my $subname (@{$subtype->[1]}) {
70 _generate_method($caller_pkg, $subname, "", \%opts, $subtype->[0]);
71 }
72 }
73}
74
75
# spent 640µs (362+279) within Class::XSAccessor::_generate_method which was called 28 times, avg 23µs/call: # 28 times (362µs+279µs) by Class::XSAccessor::import at line 61, avg 23µs/call
sub _generate_method {
76 my ($caller_pkg, $subname, $hashkey, $opts, $type) = @_;
77
78 croak("Cannot use undef as a hash key for generating an XS $type accessor. (Sub: $subname)")
79 if not defined $hashkey;
80
812846µs $subname = "${caller_pkg}::$subname" if $subname !~ /::/;
# spent 46µs making 28 calls to Class::XSAccessor::CORE:match, avg 2µs/call
82
83 Class::XSAccessor::Heavy::check_sub_existence($subname) if not $opts->{replace};
84229µs
# spent 19µs (8+10) within Class::XSAccessor::BEGIN@84 which was called: # once (8µs+10µs) by Module::Runtime::require_module at line 84
no warnings 'redefine'; # don't warn about an explicitly requested redefine
# spent 19µs making 1 call to Class::XSAccessor::BEGIN@84 # spent 10µs making 1 call to warnings::unimport
85
86420µs if ($type eq 'getter') {
# spent 20µs making 4 calls to Class::XSAccessor::newxs_getter, avg 5µs/call
87 newxs_getter($subname, $hashkey);
88 }
89 elsif ($type eq 'lvalue_accessor') {
90 newxs_lvalue_accessor($subname, $hashkey);
91 }
92 elsif ($type eq 'setter') {
93 newxs_setter($subname, $hashkey, $opts->{chained}||0);
94 }
95 elsif ($type eq 'def_predicate') {
96 newxs_defined_predicate($subname, $hashkey);
97 }
98 elsif ($type eq 'ex_predicate') {
99 newxs_exists_predicate($subname, $hashkey);
100 }
101 elsif ($type eq 'constructor') {
102 newxs_constructor($subname);
103 }
104 elsif ($type eq 'true') {
105 newxs_boolean($subname, 1);
106 }
107 elsif ($type eq 'false') {
108 newxs_boolean($subname, 0);
109 }
110 elsif ($type eq 'test') {
111 newxs_test($subname, $hashkey);
112 }
113 else {
11424213µs newxs_accessor($subname, $hashkey, $opts->{chained}||0);
# spent 213µs making 24 calls to Class::XSAccessor::newxs_accessor, avg 9µs/call
115 }
116}
117
1181;
119
120__END__
 
# spent 46µs within Class::XSAccessor::CORE:match which was called 28 times, avg 2µs/call: # 28 times (46µs+0s) by Class::XSAccessor::_generate_method at line 81, avg 2µs/call
sub Class::XSAccessor::CORE:match; # opcode
# spent 213µs within Class::XSAccessor::newxs_accessor which was called 24 times, avg 9µs/call: # 24 times (213µs+0s) by Class::XSAccessor::_generate_method at line 114, avg 9µs/call
sub Class::XSAccessor::newxs_accessor; # xsub
# spent 20µs within Class::XSAccessor::newxs_getter which was called 4 times, avg 5µs/call: # 4 times (20µs+0s) by Class::XSAccessor::_generate_method at line 86, avg 5µs/call
sub Class::XSAccessor::newxs_getter; # xsub