← 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:09:10 2010

Filename/home/doy/nytprof/kioku-new/accessor value (defined at /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/KiokuDB/Thunk.pm line 24)
StatementsExecuted 2 statements in 46µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11128µs28µsEval::Closure::::__ANON__[accessor value (defined at KiokuDB/Thunk.pm line 24):23]Eval::Closure::__ANON__[accessor value (defined at KiokuDB/Thunk.pm line 24):23]
0000s0sEval::Closure::::__ANON__[accessor value (defined at KiokuDB/Thunk.pm line 24):22]Eval::Closure::__ANON__[accessor value (defined at KiokuDB/Thunk.pm line 24):22]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
# spent 28µs within Eval::Closure::__ANON__[accessor value (defined at /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/KiokuDB/Thunk.pm line 24):23] which was called: # once (28µs+0s) by Eval::Closure::_clean_eval_closure at line 94 of Eval/Closure.pm
sub {
2my $attr = ${$_[0]};
3my $meta = ${$_[1]};
4my $type_constraint = ${$_[2]};
5my $type_constraint_obj = ${$_[3]};
6#line 1 "accessor value (defined at /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/KiokuDB/Thunk.pm line 24)"
7sub {
8if (@_ > 1) {
9$meta->throw_error("Cannot assign a value to a read-only accessor", data => \@_);
10}
11if (!exists $_[0]->{"value"}) {
12my $default;
13if (my $builder = $_[0]->can($attr->builder)) {
14$default = $_[0]->$builder;
15}
16else {
17my $class = ref($_[0]) || $_[0];
18my $builder_name = $attr->builder;
19my $attr_name = $attr->name;
20$meta->throw_error("$class does not support builder method '$builder_name' for attribute '$attr_name'");
21}
22if (!$type_constraint->($default)) {
23127µs$meta->throw_error("Attribute (value) does not pass the type constraint because: " . $type_constraint_obj->get_message($default), data => $default);
24119µs}
25$_[0]->{"value"} = $default;
26}
27return $_[0]->{"value"};
28}
29}
30;