← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:23:01 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/DBIx/Class/Relationship/ProxyMethods.pm
StatementsExecuted 200 statements in 643µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
6011409µs842µsDBIx::Class::Relationship::ProxyMethods::::register_relationshipDBIx::Class::Relationship::ProxyMethods::register_relationship
11114µs16µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@4DBIx::Class::Relationship::ProxyMethods::BEGIN@4
1117µs88µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@7DBIx::Class::Relationship::ProxyMethods::BEGIN@7
1117µs17µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@5DBIx::Class::Relationship::ProxyMethods::BEGIN@5
1117µs18µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@25DBIx::Class::Relationship::ProxyMethods::BEGIN@25
1117µs17µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@26DBIx::Class::Relationship::ProxyMethods::BEGIN@26
1114µs4µsDBIx::Class::Relationship::ProxyMethods::::BEGIN@6DBIx::Class::Relationship::ProxyMethods::BEGIN@6
0000s0sDBIx::Class::Relationship::ProxyMethods::::__ANON__[:38]DBIx::Class::Relationship::ProxyMethods::__ANON__[:38]
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
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
4319µs218µs
# spent 16µs (14+2) within DBIx::Class::Relationship::ProxyMethods::BEGIN@4 which was called: # once (14µs+2µs) by Class::C3::Componentised::ensure_class_loaded at line 4
use strict;
# spent 16µs making 1 call to DBIx::Class::Relationship::ProxyMethods::BEGIN@4 # spent 2µs making 1 call to strict::import
5322µs226µs
# spent 17µs (7+9) within DBIx::Class::Relationship::ProxyMethods::BEGIN@5 which was called: # once (7µs+9µs) by Class::C3::Componentised::ensure_class_loaded at line 5
use warnings;
# spent 17µs making 1 call to DBIx::Class::Relationship::ProxyMethods::BEGIN@5 # spent 10µs making 1 call to warnings::import
6319µs14µs
# spent 4µs within DBIx::Class::Relationship::ProxyMethods::BEGIN@6 which was called: # once (4µs+0s) by Class::C3::Componentised::ensure_class_loaded at line 6
use Sub::Name ();
7389µs2169µs
# spent 88µs (7+81) within DBIx::Class::Relationship::ProxyMethods::BEGIN@7 which was called: # once (7µs+81µs) by Class::C3::Componentised::ensure_class_loaded at line 7
use base qw/DBIx::Class/;
# spent 88µs making 1 call to DBIx::Class::Relationship::ProxyMethods::BEGIN@7 # spent 81µs making 1 call to base::import
8
912µsour %_pod_inherit_config =
10 (
11 class_map => { 'DBIx::Class::Relationship::ProxyMethods' => 'DBIx::Class::Relationship' }
12 );
13
14
# spent 842µs (409+433) within DBIx::Class::Relationship::ProxyMethods::register_relationship which was called 60 times, avg 14µs/call: # 60 times (409µs+433µs) by DBIx::Class::Relationship::Accessor::register_relationship at line 28 of mro.pm, avg 14µs/call
sub register_relationship {
15180292µs my ($class, $rel, $info) = @_;
16 if (my $proxy_args = $info->{attrs}{proxy}) {
17 $class->proxy_to_related($rel, $proxy_args);
18 }
1960385µs $class->next::method($rel, $info);
# spent 385µs making 60 calls to next::method, avg 6µs/call
20}
21
22sub proxy_to_related {
23 my ($class, $rel, $proxy_args) = @_;
24 my %proxy_map = $class->_build_proxy_map_from($proxy_args);
25319µs229µs
# spent 18µs (7+11) within DBIx::Class::Relationship::ProxyMethods::BEGIN@25 which was called: # once (7µs+11µs) by Class::C3::Componentised::ensure_class_loaded at line 25
no strict 'refs';
# spent 18µs making 1 call to DBIx::Class::Relationship::ProxyMethods::BEGIN@25 # spent 11µs making 1 call to strict::unimport
263180µs227µs
# spent 17µs (7+10) within DBIx::Class::Relationship::ProxyMethods::BEGIN@26 which was called: # once (7µs+10µs) by Class::C3::Componentised::ensure_class_loaded at line 26
no warnings 'redefine';
# spent 17µs making 1 call to DBIx::Class::Relationship::ProxyMethods::BEGIN@26 # spent 10µs making 1 call to warnings::unimport
27 foreach my $meth_name ( keys %proxy_map ) {
28 my $proxy_to_col = $proxy_map{$meth_name};
29 my $name = join '::', $class, $meth_name;
30 *$name = Sub::Name::subname $name => sub {
31 my $self = shift;
32 my $relobj = $self->$rel;
33 if (@_ && !defined $relobj) {
34 $relobj = $self->create_related($rel, { $proxy_to_col => $_[0] });
35 @_ = ();
36 }
37 return ($relobj ? $relobj->$proxy_to_col(@_) : undef);
38 }
39 }
40}
41
42sub _build_proxy_map_from {
43 my ( $class, $proxy_arg ) = @_;
44 my $ref = ref $proxy_arg;
45
46 if ($ref eq 'HASH') {
47 return %$proxy_arg;
48 }
49 elsif ($ref eq 'ARRAY') {
50 return map {
51 (ref $_ eq 'HASH')
52 ? (%$_)
53 : ($_ => $_)
54 } @$proxy_arg;
55 }
56 elsif ($ref) {
57 $class->throw_exception("Unable to process the 'proxy' argument $proxy_arg");
58 }
59 else {
60 return ( $proxy_arg => $proxy_arg );
61 }
62}
63
6413µs1;