← 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 13:01:18 2016
Reported on Fri Jan 8 13:01:34 2016

Filename/usr/lib/x86_64-linux-gnu/perl5/5.20/Class/XSAccessor.pm
StatementsExecuted 2053 statements in 4.55ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
30221.42ms2.19msClass::XSAccessor::::importClass::XSAccessor::import
111672µs872µsClass::XSAccessor::::BEGIN@6Class::XSAccessor::BEGIN@6
3011282µs541µsClass::XSAccessor::::_generate_methodClass::XSAccessor::_generate_method
24081231µs231µsClass::XSAccessor::::_make_hashClass::XSAccessor::_make_hash
2611205µs205µsClass::XSAccessor::::newxs_accessorClass::XSAccessor::newxs_accessor (xsub)
301135µs35µsClass::XSAccessor::::CORE:matchClass::XSAccessor::CORE:match (opcode)
11134µs34µsClass::XSAccessor::::BEGIN@2Class::XSAccessor::BEGIN@2
11130µs63µsClass::XSAccessor::::BEGIN@84Class::XSAccessor::BEGIN@84
11121µs37µsClass::XSAccessor::::BEGIN@3Class::XSAccessor::BEGIN@3
41119µs19µsClass::XSAccessor::::newxs_getterClass::XSAccessor::newxs_getter (xsub)
11113µs56µsClass::XSAccessor::::BEGIN@5Class::XSAccessor::BEGIN@5
11112µs24µsClass::XSAccessor::::BEGIN@4Class::XSAccessor::BEGIN@4
11111µs11µ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;
2274µs134µs
# spent 34µs within Class::XSAccessor::BEGIN@2 which was called: # once (34µs+0s) by Module::Runtime::require_module at line 2
use 5.008;
# spent 34µs making 1 call to Class::XSAccessor::BEGIN@2
3263µs253µs
# spent 37µs (21+16) within Class::XSAccessor::BEGIN@3 which was called: # once (21µs+16µs) by Module::Runtime::require_module at line 3
use strict;
# spent 37µs making 1 call to Class::XSAccessor::BEGIN@3 # spent 16µs making 1 call to strict::import
4256µs237µs
# spent 24µs (12+13) within Class::XSAccessor::BEGIN@4 which was called: # once (12µs+13µs) by Module::Runtime::require_module at line 4
use warnings;
# spent 24µs making 1 call to Class::XSAccessor::BEGIN@4 # spent 13µs making 1 call to warnings::import
5291µs298µs
# spent 56µs (13+42) within Class::XSAccessor::BEGIN@5 which was called: # once (13µs+42µs) by Module::Runtime::require_module at line 5
use Carp qw/croak/;
# spent 56µs making 1 call to Class::XSAccessor::BEGIN@5 # spent 42µs making 1 call to Exporter::import
62248µs1872µs
# spent 872µs (672+200) within Class::XSAccessor::BEGIN@6 which was called: # once (672µs+200µs) by Module::Runtime::require_module at line 6
use Class::XSAccessor::Heavy;
# spent 872µs making 1 call to Class::XSAccessor::BEGIN@6
72825µs111µs
# spent 11µs within Class::XSAccessor::BEGIN@7 which was called: # once (11µs+0s) by Module::Runtime::require_module at line 7
use XSLoader;
# spent 11µs making 1 call to Class::XSAccessor::BEGIN@7
8
911µsour $VERSION = '1.19';
10
111534µs1512µsXSLoader::load('Class::XSAccessor', $VERSION);
# spent 512µs making 1 call to XSLoader::load
12
13
# spent 231µs within Class::XSAccessor::_make_hash which was called 240 times, avg 963ns/call: # 30 times (60µs+0s) by Class::XSAccessor::import at line 37, avg 2µs/call # 30 times (28µs+0s) by Class::XSAccessor::import at line 38, avg 937ns/call # 30 times (27µs+0s) by Class::XSAccessor::import at line 40, avg 897ns/call # 30 times (25µs+0s) by Class::XSAccessor::import at line 41, avg 830ns/call # 30 times (24µs+0s) by Class::XSAccessor::import at line 39, avg 813ns/call # 30 times (23µs+0s) by Class::XSAccessor::import at line 44, avg 760ns/call # 30 times (22µs+0s) by Class::XSAccessor::import at line 42, avg 740ns/call # 30 times (22µs+0s) by Class::XSAccessor::import at line 43, avg 730ns/call
sub _make_hash {
1424031µs my $ref = shift;
15
1624066µs if (ref ($ref)) {
17 if (ref($ref) eq 'ARRAY') {
18 $ref = { map { $_ => $_ } @$ref }
19 }
20 } else {
21 $ref = { $ref, $ref };
22 }
23
24240349µs return $ref;
25}
26
27
# spent 2.19ms (1.42+772µs) within Class::XSAccessor::import which was called 30 times, avg 73µs/call: # 26 times (1.26ms+684µ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::Row::in_storage 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::disable_sth_caching 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 75µs/call # 4 times (164µs+87µs) by Method::Generate::Accessor::_generate_xs at line 641 of Method/Generate/Accessor.pm, avg 63µs/call
sub import {
283011µs my $own_class = shift;
293037µs my ($caller_pkg) = caller();
30
31 # Support both { getters => ... } and plain getters => ...
323068µs my %opts = ref($_[0]) eq 'HASH' ? %{$_[0]} : @_;
33
343021µs $caller_pkg = $opts{class} if defined $opts{class};
35
36 # TODO: Refactor. Move more duplicated code to ::Heavy
373050µs3060µs my $read_subs = _make_hash($opts{getters} || {});
# spent 60µs making 30 calls to Class::XSAccessor::_make_hash, avg 2µs/call
383035µs3028µs my $set_subs = _make_hash($opts{setters} || {});
# spent 28µs making 30 calls to Class::XSAccessor::_make_hash, avg 937ns/call
393027µs3024µs my $acc_subs = _make_hash($opts{accessors} || {});
# spent 24µs making 30 calls to Class::XSAccessor::_make_hash, avg 813ns/call
403030µs3027µs my $lvacc_subs = _make_hash($opts{lvalue_accessors} || {});
# spent 27µs making 30 calls to Class::XSAccessor::_make_hash, avg 897ns/call
413031µs3025µs my $pred_subs = _make_hash($opts{predicates} || {});
# spent 25µs making 30 calls to Class::XSAccessor::_make_hash, avg 830ns/call
423028µs3022µs my $ex_pred_subs = _make_hash($opts{exists_predicates} || {});
# spent 22µs making 30 calls to Class::XSAccessor::_make_hash, avg 740ns/call
433026µs3022µs my $def_pred_subs = _make_hash($opts{defined_predicates} || {});
# spent 22µs making 30 calls to Class::XSAccessor::_make_hash, avg 730ns/call
443028µs3023µs my $test_subs = _make_hash($opts{__tests__} || {});
# spent 23µs making 30 calls to Class::XSAccessor::_make_hash, avg 760ns/call
453025µs my $construct_subs = $opts{constructors} || [defined($opts{constructor}) ? $opts{constructor} : ()];
463013µs my $true_subs = $opts{true} || [];
473013µs my $false_subs = $opts{false} || [];
48
4930119µs 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 {
5824060µs my $subs = $subtype->[1];
59240289µs foreach my $subname (keys %$subs) {
603018µs my $hashkey = $subs->{$subname};
613098µs30541µs _generate_method($caller_pkg, $subname, $hashkey, \%opts, $subtype->[0]);
# spent 541µs making 30 calls to Class::XSAccessor::_generate_method, avg 18µs/call
62 }
63 }
64
6530200µs foreach my $subtype ( ["constructor", $construct_subs],
66 ["true", $true_subs],
67 ["false", $false_subs] )
68 {
699050µs foreach my $subname (@{$subtype->[1]}) {
70 _generate_method($caller_pkg, $subname, "", \%opts, $subtype->[0]);
71 }
72 }
73}
74
75
# spent 541µs (282+259) within Class::XSAccessor::_generate_method which was called 30 times, avg 18µs/call: # 30 times (282µs+259µs) by Class::XSAccessor::import at line 61, avg 18µs/call
sub _generate_method {
763021µs my ($caller_pkg, $subname, $hashkey, $opts, $type) = @_;
77
78309µs croak("Cannot use undef as a hash key for generating an XS $type accessor. (Sub: $subname)")
79 if not defined $hashkey;
80
8130126µs3035µs $subname = "${caller_pkg}::$subname" if $subname !~ /::/;
# spent 35µs making 30 calls to Class::XSAccessor::CORE:match, avg 1µs/call
82
833011µs Class::XSAccessor::Heavy::check_sub_existence($subname) if not $opts->{replace};
842370µs296µs
# spent 63µs (30+33) within Class::XSAccessor::BEGIN@84 which was called: # once (30µs+33µs) by Module::Runtime::require_module at line 84
no warnings 'redefine'; # don't warn about an explicitly requested redefine
# spent 63µs making 1 call to Class::XSAccessor::BEGIN@84 # spent 33µs making 1 call to warnings::unimport
85
8630114µs419µs if ($type eq 'getter') {
# spent 19µ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 {
11426268µs26205µs newxs_accessor($subname, $hashkey, $opts->{chained}||0);
# spent 205µs making 26 calls to Class::XSAccessor::newxs_accessor, avg 8µs/call
115 }
116}
117
118112µs1;
119
120__END__
 
# spent 35µs within Class::XSAccessor::CORE:match which was called 30 times, avg 1µs/call: # 30 times (35µs+0s) by Class::XSAccessor::_generate_method at line 81, avg 1µs/call
sub Class::XSAccessor::CORE:match; # opcode
# spent 205µs within Class::XSAccessor::newxs_accessor which was called 26 times, avg 8µs/call: # 26 times (205µs+0s) by Class::XSAccessor::_generate_method at line 114, avg 8µs/call
sub Class::XSAccessor::newxs_accessor; # xsub
# spent 19µs within Class::XSAccessor::newxs_getter which was called 4 times, avg 5µs/call: # 4 times (19µs+0s) by Class::XSAccessor::_generate_method at line 86, avg 5µs/call
sub Class::XSAccessor::newxs_getter; # xsub