← 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:50:58 2016
Reported on Fri Jan 8 13:51:27 2016

Filename/usr/share/perl5/DBIx/Class/Relationship/ProxyMethods.pm
StatementsExecuted 969 statements in 8.22ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11116µs81µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@6DBIx::Class::Relationship::ProxyMethods::BEGIN@6
11114µs21µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@4DBIx::Class::Relationship::ProxyMethods::BEGIN@4
1118µs81µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@8DBIx::Class::Relationship::ProxyMethods::BEGIN@8
1118µs30µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@7DBIx::Class::Relationship::ProxyMethods::BEGIN@7
1118µs12µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@5DBIx::Class::Relationship::ProxyMethods::BEGIN@5
0000s0sDBIx::Class::Relationship::ProxyMethods::::_build_proxy_map_fromDBIx::Class::Relationship::ProxyMethods::_build_proxy_map_from
0000s0sDBIx::Class::Relationship::ProxyMethods::::proxy_to_relatedDBIx::Class::Relationship::ProxyMethods::proxy_to_related
0000s0sDBIx::Class::Relationship::ProxyMethods::::register_relationshipDBIx::Class::Relationship::ProxyMethods::register_relationship
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package # hide from PAUSE
2 DBIx::Class::Relationship::ProxyMethods;
3
4236µs228µs
# spent 21µs (14+7) within DBIx::Class::Relationship::ProxyMethods::BEGIN@4 which was called: # once (14µs+7µs) by Class::C3::Componentised::ensure_class_loaded at line 4
use strict;
# spent 21µs making 1 call to DBIx::Class::Relationship::ProxyMethods::BEGIN@4 # spent 7µs making 1 call to strict::import
5234µs217µs
# spent 12µs (8+4) within DBIx::Class::Relationship::ProxyMethods::BEGIN@5 which was called: # once (8µs+4µs) by Class::C3::Componentised::ensure_class_loaded at line 5
use warnings;
# spent 12µs making 1 call to DBIx::Class::Relationship::ProxyMethods::BEGIN@5 # spent 4µs making 1 call to warnings::import
62107µs281µs
# spent 81µs (16+65) within DBIx::Class::Relationship::ProxyMethods::BEGIN@6 which was called: # once (16µs+65µs) by Class::C3::Componentised::ensure_class_loaded at line 6
use base 'DBIx::Class';
# spent 81µs making 1 call to DBIx::Class::Relationship::ProxyMethods::BEGIN@6 # spent 65µs making 1 call to base::import, recursion: max depth 1, sum of overlapping time 65µs
7250µs251µs
# spent 30µs (8+21) within DBIx::Class::Relationship::ProxyMethods::BEGIN@7 which was called: # once (8µs+21µs) by Class::C3::Componentised::ensure_class_loaded at line 7
use DBIx::Class::_Util 'quote_sub';
# spent 30µs making 1 call to DBIx::Class::Relationship::ProxyMethods::BEGIN@7 # spent 21µs making 1 call to Exporter::import
82899µs2154µs
# spent 81µs (8+73) within DBIx::Class::Relationship::ProxyMethods::BEGIN@8 which was called: # once (8µs+73µs) by Class::C3::Componentised::ensure_class_loaded at line 8
use namespace::clean;
# spent 81µs making 1 call to DBIx::Class::Relationship::ProxyMethods::BEGIN@8 # spent 73µs making 1 call to namespace::clean::import
9
1012µsour %_pod_inherit_config =
11 (
12 class_map => { 'DBIx::Class::Relationship::ProxyMethods' => 'DBIx::Class::Relationship' }
13 );
14
15sub register_relationship {
16319200µs my ($class, $rel, $info) = @_;
17319251µs if (my $proxy_args = $info->{attrs}{proxy}) {
18 $class->proxy_to_related($rel, $proxy_args);
19 }
203196.63ms3191.36ms $class->next::method($rel, $info);
# spent 1.36ms making 319 calls to next::method, avg 4µs/call
21}
22
23sub proxy_to_related {
24 my ($class, $rel, $proxy_args) = @_;
25 my %proxy_map = $class->_build_proxy_map_from($proxy_args);
26
27 quote_sub "${class}::$_", sprintf( <<'EOC', $rel, $proxy_map{$_} )
28 my $self = shift;
29 my $relobj = $self->%1$s;
30 if (@_ && !defined $relobj) {
31 $relobj = $self->create_related( %1$s => { %2$s => $_[0] } );
32 @_ = ();
33 }
34 $relobj ? $relobj->%2$s(@_) : undef;
35EOC
36 for keys %proxy_map
37}
38
39sub _build_proxy_map_from {
40 my ( $class, $proxy_arg ) = @_;
41 my $ref = ref $proxy_arg;
42
43 if ($ref eq 'HASH') {
44 return %$proxy_arg;
45 }
46 elsif ($ref eq 'ARRAY') {
47 return map {
48 (ref $_ eq 'HASH')
49 ? (%$_)
50 : ($_ => $_)
51 } @$proxy_arg;
52 }
53 elsif ($ref) {
54 $class->throw_exception("Unable to process the 'proxy' argument $proxy_arg");
55 }
56 else {
57 return ( $proxy_arg => $proxy_arg );
58 }
59}
60
6113µs1536µs1;
# spent 536µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__