← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/dpath
  Run on Tue Jun 5 15:31:33 2012
Reported on Tue Jun 5 15:31:43 2012

Filename/home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Class/Data/Inheritable.pm
StatementsExecuted 52 statements in 1.17ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
551202µs202µsClass::Data::Inheritable::::mk_classdataClass::Data::Inheritable::mk_classdata
44148µs48µsClass::Data::Inheritable::::__ANON__[:23]Class::Data::Inheritable::__ANON__[:23]
11146µs147µsClass::Data::Inheritable::::BEGIN@3Class::Data::Inheritable::BEGIN@3
11126µs127µsClass::Data::Inheritable::::BEGIN@4Class::Data::Inheritable::BEGIN@4
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Class::Data::Inheritable;
2
3299µs2248µs
# spent 147µs (46+101) within Class::Data::Inheritable::BEGIN@3 which was called: # once (46µs+101µs) by Exception::Class::Base::BEGIN@9 at line 3
use strict qw(vars subs);
# spent 147µs making 1 call to Class::Data::Inheritable::BEGIN@3 # spent 101µs making 1 call to strict::import
42734µs2228µs
# spent 127µs (26+101) within Class::Data::Inheritable::BEGIN@4 which was called: # once (26µs+101µs) by Exception::Class::Base::BEGIN@9 at line 4
use vars qw($VERSION);
# spent 127µs making 1 call to Class::Data::Inheritable::BEGIN@4 # spent 101µs making 1 call to vars::import
513µs$VERSION = '0.08';
6
7
# spent 202µs within Class::Data::Inheritable::mk_classdata which was called 5 times, avg 40µs/call: # once (52µs+0s) by Exception::Class::Base::BEGIN@15 at line 16 of Exception/Class/Base.pm # once (40µs+0s) by Exception::Class::Base::BEGIN@15 at line 20 of Exception/Class/Base.pm # once (38µs+0s) by Exception::Class::Base::BEGIN@15 at line 26 of Exception/Class/Base.pm # once (37µs+0s) by Exception::Class::Base::BEGIN@15 at line 17 of Exception/Class/Base.pm # once (35µs+0s) by Exception::Class::Base::BEGIN@15 at line 23 of Exception/Class/Base.pm
sub mk_classdata {
830241µs my ($declaredclass, $attribute, $data) = @_;
9
10 if( ref $declaredclass ) {
11 require Carp;
12 Carp::croak("mk_classdata() is a class method, not an object method");
13 }
14
15
# spent 48µs within Class::Data::Inheritable::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Class/Data/Inheritable.pm:23] which was called 4 times, avg 12µs/call: # once (15µs+0s) by Exception::Class::Base::BEGIN@15 at line 18 of Exception/Class/Base.pm # once (11µs+0s) by Exception::Class::Base::BEGIN@15 at line 27 of Exception/Class/Base.pm # once (11µs+0s) by Exception::Class::Base::BEGIN@15 at line 21 of Exception/Class/Base.pm # once (10µs+0s) by Exception::Class::Base::BEGIN@15 at line 24 of Exception/Class/Base.pm
my $accessor = sub {
161677µs my $wantclass = ref($_[0]) || $_[0];
17
18 return $wantclass->mk_classdata($attribute)->(@_)
19 if @_>1 && $wantclass ne $declaredclass;
20
21 $data = $_[1] if @_>1;
22 return $data;
23 };
24
25 my $alias = "_${attribute}_accessor";
26 *{$declaredclass.'::'.$attribute} = $accessor;
27 *{$declaredclass.'::'.$alias} = $accessor;
28}
29
30112µs1;
31
32__END__