← 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:04:54 2010

Filename/home/doy/nytprof/kioku-new/accessor _native_type (defined at /home/doy/coding/src/Moose/blib/lib//Moose/Meta/Attribute/Native/Trait.pm line 191)
StatementsExecuted 41 statements in 521µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
21177µs77µsEval::Closure::::__ANON__[accessor _native_type (defined at Moose/Meta/Attribute/Native/Trait.pm line 191):23]Eval::Closure::__ANON__[accessor _native_type (defined at Moose/Meta/Attribute/Native/Trait.pm line 191):23]
0000s0sEval::Closure::::__ANON__[accessor _native_type (defined at Moose/Meta/Attribute/Native/Trait.pm line 191):22]Eval::Closure::__ANON__[accessor _native_type (defined at Moose/Meta/Attribute/Native/Trait.pm line 191):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 77µs within Eval::Closure::__ANON__[accessor _native_type (defined at /home/doy/coding/src/Moose/blib/lib//Moose/Meta/Attribute/Native/Trait.pm line 191):23] which was called 2 times, avg 39µs/call: # 2 times (77µs+0s) by Eval::Closure::_clean_eval_closure at line 94 of Eval/Closure.pm, avg 39µs/call
sub {
238427µsmy $attr = ${$_[0]};
3my $meta = ${$_[1]};
4my $type_constraint = ${$_[2]};
5my $type_constraint_obj = ${$_[3]};
6#line 1 "accessor _native_type (defined at /home/doy/coding/src/Moose/blib/lib//Moose/Meta/Attribute/Native/Trait.pm line 191)"
761.06mssub {
# spent 1.03ms making 2 calls to Moose::Meta::Attribute::Native::Trait::_build_native_type, avg 517µs/call # spent 15µs making 2 calls to UNIVERSAL::can, avg 7µs/call # spent 14µs making 2 calls to Class::MOP::Mixin::AttributeCore::builder, avg 7µs/call
8if (@_ > 1) {
9$meta->throw_error("Cannot assign a value to a read-only accessor", data => \@_);
10}
11if (!exists $_[0]->{"_native_type"}) {
12my $default;
13if (my $builder = $_[0]->can($attr->builder)) {
14$default = $_[0]->$builder;
15}
16233µselse {
# spent 33µs making 2 calls to Moose::Util::TypeConstraints::OptimizedConstraints::Str, avg 17µs/call
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)) {
23267µs$meta->throw_error("Attribute (_native_type) does not pass the type constraint because: " . $type_constraint_obj->get_message($default), data => $default);
24126µs}
25$_[0]->{"_native_type"} = $default;
26}
27return $_[0]->{"_native_type"};
28}
29}
30;