Profile of Class/Data/Inheritable.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:23:00 2012

Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Class/Data/Inheritable.pm
Statements | Executed 1716 statements in 1.79ms

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
413 | 5 | 3 | 983µs | 1.10ms | Class::Data::Inheritable::::__ANON__[:23]Class::Data::Inheritable::__ANON__[:23]
12 | 3 | 3 | 146µs | 146µs | Class::Data::Inheritable::::mk_classdataClass::Data::Inheritable::mk_classdata
1 | 1 | 1 | 16µs | 28µs | Class::Data::Inheritable::::BEGIN@3Class::Data::Inheritable::BEGIN@3
1 | 1 | 1 | 11µs | 38µs | Class::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
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Class::Data::Inheritable;
2 |  |  |  |  |
3 | 3 | 20µs | 2 | 41µs | # spent 28µs (16+13) within Class::Data::Inheritable::BEGIN@3 which was called: # once (16µs+13µs) by base::import at line 3 use strict qw(vars subs); # spent 28µs making 1 call to Class::Data::Inheritable::BEGIN@3 # spent 13µs making 1 call to strict::import
4 | 3 | 141µs | 2 | 66µs | # spent 38µs (11+27) within Class::Data::Inheritable::BEGIN@4 which was called: # once (11µs+27µs) by base::import at line 4 use vars qw($VERSION); # spent 38µs making 1 call to Class::Data::Inheritable::BEGIN@4 # spent 27µs making 1 call to vars::import
5 | 1 | 600ns |  |  | $VERSION = '0.08';
6 |  |  |  |  |
7 |  |  |  |  | # spent 146µs within Class::Data::Inheritable::mk_classdata which was called 12 times, avg 12µs/call: # 8 times (100µs+0s) by Class::Data::Inheritable::__ANON__[/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Class/Data/Inheritable.pm:23] at line 18, avg 13µs/call # 3 times (31µs+0s) by DBIx::Class::InflateColumn::Object::Enum::BEGIN@6 at line 15 of Object/Enum.pm, avg 10µs/call # once (15µs+0s) by base::import at line 84 of SQL/Translator/Schema/Object.pm sub mk_classdata {
8 | 72 | 172µ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 1.10ms (983µs+120µs) within Class::Data::Inheritable::__ANON__[/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Class/Data/Inheritable.pm:23] which was called 413 times, avg 3µs/call: # 387 times (821µs+0s) by SQL::Translator::Schema::Object::_attributes at line 95 of SQL/Translator/Schema/Object.pm, avg 2µs/call # 16 times (134µs+120µs) by SQL::Translator::Schema::Object::_attributes at line 94 of SQL/Translator/Schema/Object.pm, avg 16µs/call # 8 times (20µs+0s) by Class::Data::Inheritable::__ANON__[/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Class/Data/Inheritable.pm:23] at line 18, avg 2µs/call # once (4µs+0s) by base::import at line 87 of SQL/Translator/Schema/Object.pm # once (4µs+0s) by DBIx::Class::InflateColumn::Object::Enum::BEGIN@6 at line 25 of Object/Enum.pm my $accessor = sub {
16 | 1636 | 1.45ms |  |  | my $wantclass = ref($_[0]) || $_[0];
17 |  |  |  |  |
18 |  |  | 16 | 120µs | return $wantclass->mk_classdata($attribute)->(@_) # spent 100µs making 8 calls to Class::Data::Inheritable::mk_classdata, avg 13µs/call # spent 20µs making 8 calls to Class::Data::Inheritable::__ANON__[Class/Data/Inheritable.pm:23], avg 2µs/call
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 |  |  |  |  |
30 | 1 | 2µs |  |  | 1;
31 |  |  |  |  |
32 |  |  |  |  | __END__