← Index
Performance Profile   « block view • line view • sub view »
For /wise/base/deliv/dev/bin/getfix
  Run on Thu May 20 15:30:03 2010
Reported on Thu May 20 16:25:21 2010

File/wise/base/static/lib/perl5/site_perl/5.10.0/DBIx/Class/ResultSourceHandle.pm
Statements Executed222005
Total Time1.0993830000004 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
55541210.480433.59317DBIx::Class::ResultSourceHandle::resolve
55482110.424030.42403DBIx::Class::ResultSourceHandle::new
00000DBIx::Class::ResultSourceHandle::BEGIN
00000DBIx::Class::ResultSourceHandle::STORABLE_freeze
00000DBIx::Class::ResultSourceHandle::STORABLE_thaw
00000DBIx::Class::ResultSourceHandle::__ANON__[:12]

LineStmts.Exclusive
Time
Avg.Code
1package DBIx::Class::ResultSourceHandle;
2
333.5e-51.2e-5use strict;
# spent 11µs making 1 call to strict::import
433.1e-51.0e-5use warnings;
# spent 23µs making 1 call to warnings::import
534.0e-51.3e-5use Storable;
# spent 68µs making 1 call to Exporter::import
6
736.7e-52.2e-5use base qw/DBIx::Class/;
# spent 71µs making 1 call to base::import, max recursion depth 1
8
9use overload
10 # on some RH perls the following line causes serious performance problem
11 # see https://bugzilla.redhat.com/show_bug.cgi?id=196836
12 q/""/ => sub { __PACKAGE__ . ":" . shift->source_moniker; },
1330.000227.5e-5 fallback => 1;
# spent 77µs making 1 call to overload::import
14
1511.5e-51.5e-5__PACKAGE__->mk_group_accessors('simple' => qw/schema source_moniker/);
# spent 261µs making 1 call to Class::Accessor::Grouped::mk_group_accessors
16
17# Schema to use when thawing.
18100our $thaw_schema;
19
20=head1 NAME
21
22DBIx::Class::ResultSourceHandle
23
24=head1 DESCRIPTION
25
26This module removes fixed link between Rows/ResultSets and the actual source
27objects, which gets round the following problems
28
29=over 4
30
31=item *
32
33Needing to keep C<$schema> in scope, since any objects/result_sets
34will have a C<$schema> object through their source handle
35
36=item *
37
38Large output when using Data::Dump(er) since this class can be set to
39stringify to almost nothing
40
41=item *
42
43Closer to being able to do a Serialize::Storable that doesn't require class-based connections
44
45=back
46
47=head1 METHODS
48
49=head2 new
50
51=cut
52
53
# spent 424ms within DBIx::Class::ResultSourceHandle::new which was called 55482 times, avg 8µs/call: # 55482 times (424ms+0) by DBIx::Class::ResultSource::handle at line 1041 of /wise/base/static/lib/perl5/site_perl/5.10.0/DBIx/Class/ResultSource.pm, avg 8µs/call
sub new {
541664460.285911.7e-6 my ($class, $data) = @_;
55
56 $class = ref $class if ref $class;
57
58 bless $data, $class;
59}
60
61=head2 resolve
62
63Resolve the moniker into the actual ResultSource object
64
65=cut
66
67555410.813051.5e-5
# spent 3.59s (480ms+3.11) within DBIx::Class::ResultSourceHandle::resolve which was called 55541 times, avg 65µs/call: # 55535 times (480ms+3.11s) by DBIx::Class::ResultSet::result_source at line 2115 of /wise/base/static/lib/perl5/site_perl/5.10.0/DBIx/Class/ResultSet.pm, avg 65µs/call # 6 times (54µs+411µs) by DBIx::Class::ResultSet::new at line 101 of /wise/base/static/lib/perl5/site_perl/5.10.0/DBIx/Class/ResultSet.pm, avg 78µs/call
sub resolve { return $_[0]->schema->source($_[0]->source_moniker) }
# spent 1.77s making 55541 calls to DBIx::Class::Schema::source, avg 32µs/call # spent 1.34s making 111082 calls to Class::Accessor::Grouped::__ANON__[(eval 0)[/wise/base/static/lib/perl5/site_perl/5.10.0/Class/Accessor/Grouped.pm:156]:8], avg 12µs/call
68
69=head2 STORABLE_freeze
70
71Freezes a handle.
72
73=cut
74
75sub STORABLE_freeze {
76 my ($self, $cloning) = @_;
77
78 my $to_serialize = { %$self };
79
80 delete $to_serialize->{schema};
81 return (Storable::freeze($to_serialize));
82}
83
84=head2 STORABLE_thaw
85
86Thaws frozen handle. Resets the internal schema reference to the package
87variable C<$thaw_schema>. The recomened way of setting this is to use
88C<$schema->thaw($ice)> which handles this for you.
89
90=cut
91
92
93sub STORABLE_thaw {
94 my ($self, $cloning,$ice) = @_;
95 %$self = %{ Storable::thaw($ice) };
96 $self->{schema} = $thaw_schema;
97}
98
99=head1 AUTHOR
100
101Ash Berlin C<< <ash@cpan.org> >>
102
103=cut
104
10514.0e-64.0e-61;