Profile of Class/Accessor/Fast.pm

← 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:22:36 2012

Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Class/Accessor/Fast.pm
Statements | Executed 38 statements in 292µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
13 | 1 | 1 | 56µs | 56µs | Class::Accessor::Fast::::make_ro_accessorClass::Accessor::Fast::make_ro_accessor
2 | 1 | 1 | 13µs | 13µs | Class::Accessor::Fast::::make_accessorClass::Accessor::Fast::make_accessor
1 | 1 | 1 | 12µs | 1.23ms | Class::Accessor::Fast::::BEGIN@2Class::Accessor::Fast::BEGIN@2
1 | 1 | 1 | 6µs | 8µs | Class::Accessor::Fast::::BEGIN@3Class::Accessor::Fast::BEGIN@3
0 | 0 | 0 | 0s | 0s | Class::Accessor::Fast::::__ANON__[:12]Class::Accessor::Fast::__ANON__[:12]
0 | 0 | 0 | 0s | 0s | Class::Accessor::Fast::::__ANON__[:23]Class::Accessor::Fast::__ANON__[:23]
0 | 0 | 0 | 0s | 0s | Class::Accessor::Fast::::__ANON__[:39]Class::Accessor::Fast::__ANON__[:39]
0 | 0 | 0 | 0s | 0s | Class::Accessor::Fast::::make_wo_accessorClass::Accessor::Fast::make_wo_accessor

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Class::Accessor::Fast;
2 | 3 | 19µs | 2 | 1.23ms | # spent 1.23ms (12µs+1.21) within Class::Accessor::Fast::BEGIN@2 which was called: # once (12µs+1.21ms) by base::import at line 2 use base 'Class::Accessor'; # spent 1.23ms making 1 call to Class::Accessor::Fast::BEGIN@2 # spent 1.21ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 1.21ms
3 | 3 | 186µs | 2 | 11µs | # spent 8µs (6+2) within Class::Accessor::Fast::BEGIN@3 which was called: # once (6µs+2µs) by base::import at line 3 use strict; # spent 8µs making 1 call to Class::Accessor::Fast::BEGIN@3 # spent 2µs making 1 call to strict::import
4 | 1 | 400ns |  |  | $Class::Accessor::Fast::VERSION = '0.34';
5 |  |  |  |  |
6 |  |  |  |  | # spent 13µs within Class::Accessor::Fast::make_accessor which was called 2 times, avg 6µs/call: # 2 times (13µs+0s) by Class::Accessor::_mk_accessors at line 72 of Class/Accessor.pm, avg 6µs/call sub make_accessor {
7 | 4 | 16µs |  |  | my($class, $field) = @_;
8 |  |  |  |  |
9 |  |  |  |  | return sub {
10 |  |  |  |  | return $_[0]->{$field} if scalar(@_) == 1;
11 |  |  |  |  | return $_[0]->{$field} = scalar(@_) == 2 ? $_[1] : [@_[1..$#_]];
12 |  |  |  |  | };
13 |  |  |  |  | }
14 |  |  |  |  |
15 |  |  |  |  |
16 |  |  |  |  | # spent 56µs within Class::Accessor::Fast::make_ro_accessor which was called 13 times, avg 4µs/call: # 13 times (56µs+0s) by Class::Accessor::_mk_accessors at line 72 of Class/Accessor.pm, avg 4µs/call sub make_ro_accessor {
17 | 26 | 69µs |  |  | my($class, $field) = @_;
18 |  |  |  |  |
19 |  |  |  |  | return sub {
20 |  |  |  |  | return $_[0]->{$field} if @_ == 1;
21 |  |  |  |  | my $caller = caller;
22 |  |  |  |  | $_[0]->_croak("'$caller' cannot alter the value of '$field' on objects of class '$class'");
23 |  |  |  |  | };
24 |  |  |  |  | }
25 |  |  |  |  |
26 |  |  |  |  |
27 |  |  |  |  | sub make_wo_accessor {
28 |  |  |  |  | my($class, $field) = @_;
29 |  |  |  |  |
30 |  |  |  |  | return sub {
31 |  |  |  |  | if (@_ == 1) {
32 |  |  |  |  | my $caller = caller;
33 |  |  |  |  | $_[0]->_croak("'$caller' cannot access the value of '$field' on objects of class '$class'");
34 |  |  |  |  | }
35 |  |  |  |  | else {
36 |  |  |  |  | return $_[0]->{$field} = $_[1] if @_ == 2;
37 |  |  |  |  | return (shift)->{$field} = \@_;
38 |  |  |  |  | }
39 |  |  |  |  | };
40 |  |  |  |  | }
41 |  |  |  |  |
42 |  |  |  |  |
43 | 1 | 2µs |  |  | 1;
44 |  |  |  |  |
45 |  |  |  |  | __END__