← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:42:38 2010
Reported on Wed Nov 17 22:08:48 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/KiokuDB/LiveObjects/Scope.pm
StatementsExecuted 11 statements in 1.11ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11170µs21.6msKiokuDB::LiveObjects::Scope::::BEGIN@4KiokuDB::LiveObjects::Scope::BEGIN@4
11146µs1.55msKiokuDB::LiveObjects::Scope::::BEGIN@6KiokuDB::LiveObjects::Scope::BEGIN@6
0000s0sKiokuDB::LiveObjects::Scope::::DEMOLISHKiokuDB::LiveObjects::Scope::DEMOLISH
0000s0sKiokuDB::LiveObjects::Scope::::__ANON__[:11]KiokuDB::LiveObjects::Scope::__ANON__[:11]
0000s0sKiokuDB::LiveObjects::Scope::::detachKiokuDB::LiveObjects::Scope::detach
0000s0sKiokuDB::LiveObjects::Scope::::removeKiokuDB::LiveObjects::Scope::remove
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1#!/usr/bin/perl
2
3package KiokuDB::LiveObjects::Scope;
43171µs243.2ms
# spent 21.6ms (70µs+21.6) within KiokuDB::LiveObjects::Scope::BEGIN@4 which was called: # once (70µs+21.6ms) by KiokuDB::LiveObjects::BEGIN@13 at line 4
use Moose;
# spent 21.6ms making 1 call to KiokuDB::LiveObjects::Scope::BEGIN@4 # spent 21.6ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456]
5
63757µs23.06ms
# spent 1.55ms (46µs+1.51) within KiokuDB::LiveObjects::Scope::BEGIN@6 which was called: # once (46µs+1.51ms) by KiokuDB::LiveObjects::BEGIN@13 at line 6
use namespace::clean -except => 'meta';
# spent 1.55ms making 1 call to KiokuDB::LiveObjects::Scope::BEGIN@6 # spent 1.51ms making 1 call to namespace::clean::import
7
8has objects => (
9 traits => [qw(Array)],
10 isa => "ArrayRef",
11 default => sub { [] },
12131µs1567ms clearer => "_clear_objects",
# spent 567ms making 1 call to Moose::has
13 handles => {
14 push => "push",
15 objects => "elements",
16 clear => "clear",
17 },
18);
19
20112µs17.93mshas parent => (
# spent 7.93ms making 1 call to Moose::has
21 isa => __PACKAGE__,
22 is => "ro",
23);
24
25112µs111.7mshas live_objects => (
# spent 11.7ms making 1 call to Moose::has
26 isa => "KiokuDB::LiveObjects",
27 is => "ro",
28 clearer => "_clear_live_objects",
29);
30
31sub DEMOLISH {
32 my $self = shift;
33
34 # consider possibilities of optimizing live object set removal at this
35 # point
36
37 # problems can arise from an object outliving the scope it was loaded in:
38 # { my $outer = lookup(...); { my $inner = lookup(...); $outer->foo($inner) } }
39
40 $self->remove;
41}
42
43sub detach {
44 my $self = shift;
45
46 if ( my $l = $self->live_objects ) {
47 $l->detach_scope($self);
48 }
49}
50
51sub remove {
52 my $self = shift;
53
54 if ( my $l = $self->live_objects ) { # can be false under global destruction
55 $l->remove_scope($self);
56 $self->_clear_live_objects;
57 }
58}
59
60125µs216.8ms__PACKAGE__->meta->make_immutable;
# spent 16.7ms making 1 call to Class::MOP::Class::make_immutable # spent 102µs making 1 call to KiokuDB::LiveObjects::Scope::meta
61
62162µs__PACKAGE__
63
64137µs14.34ms__END__