← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:39:01 2010
Reported on Wed Nov 17 22:04:54 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/TypeConstraint/Registry.pm
StatementsExecuted 2117 statements in 30.9ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3982111.2ms16.7msMoose::Meta::TypeConstraint::Registry::::has_type_constraintMoose::Meta::TypeConstraint::Registry::has_type_constraint
1327110.3ms16.5msMoose::Meta::TypeConstraint::Registry::::add_type_constraintMoose::Meta::TypeConstraint::Registry::add_type_constraint
300418.50ms11.7msMoose::Meta::TypeConstraint::Registry::::get_type_constraintMoose::Meta::TypeConstraint::Registry::get_type_constraint
11172µs91µsMoose::Meta::TypeConstraint::Registry::::BEGIN@4Moose::Meta::TypeConstraint::Registry::BEGIN@4
11145µs1.54msMoose::Meta::TypeConstraint::Registry::::newMoose::Meta::TypeConstraint::Registry::new
11143µs205µsMoose::Meta::TypeConstraint::Registry::::BEGIN@8Moose::Meta::TypeConstraint::Registry::BEGIN@8
11141µs315µsMoose::Meta::TypeConstraint::Registry::::BEGIN@14Moose::Meta::TypeConstraint::Registry::BEGIN@14
11139µs107µsMoose::Meta::TypeConstraint::Registry::::BEGIN@5Moose::Meta::TypeConstraint::Registry::BEGIN@5
11137µs3.06msMoose::Meta::TypeConstraint::Registry::::BEGIN@6Moose::Meta::TypeConstraint::Registry::BEGIN@6
11110µs10µsMoose::Meta::TypeConstraint::Registry::::__ANON__[:24]Moose::Meta::TypeConstraint::Registry::__ANON__[:24]
0000s0sMoose::Meta::TypeConstraint::Registry::::find_type_constraintMoose::Meta::TypeConstraint::Registry::find_type_constraint
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2package Moose::Meta::TypeConstraint::Registry;
3
43100µs2109µs
# spent 91µs (72+18) within Moose::Meta::TypeConstraint::Registry::BEGIN@4 which was called: # once (72µs+18µs) by Moose::Util::TypeConstraints::BEGIN@39 at line 4
use strict;
# spent 91µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@4 # spent 18µs making 1 call to strict::import
5394µs2174µs
# spent 107µs (39+67) within Moose::Meta::TypeConstraint::Registry::BEGIN@5 which was called: # once (39µs+67µs) by Moose::Util::TypeConstraints::BEGIN@39 at line 5
use warnings;
# spent 107µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@5 # spent 68µs making 1 call to warnings::import
63150µs26.09ms
# spent 3.06ms (37µs+3.03) within Moose::Meta::TypeConstraint::Registry::BEGIN@6 which was called: # once (37µs+3.03ms) by Moose::Util::TypeConstraints::BEGIN@39 at line 6
use metaclass;
# spent 3.06ms making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@6 # spent 3.03ms making 1 call to metaclass::import
7
83243µs2366µs
# spent 205µs (43+162) within Moose::Meta::TypeConstraint::Registry::BEGIN@8 which was called: # once (43µs+162µs) by Moose::Util::TypeConstraints::BEGIN@39 at line 8
use Scalar::Util 'blessed';
# spent 205µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@8 # spent 162µs making 1 call to Exporter::import
9
1015µsour $VERSION = '1.19';
11161µs$VERSION = eval $VERSION;
# spent 10µs executing statements in string eval
1213µsour $AUTHORITY = 'cpan:STEVAN';
13
143985µs2589µs
# spent 315µs (41+274) within Moose::Meta::TypeConstraint::Registry::BEGIN@14 which was called: # once (41µs+274µs) by Moose::Util::TypeConstraints::BEGIN@39 at line 14
use base 'Class::MOP::Object';
# spent 315µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@14 # spent 274µs making 1 call to base::import
15
16125µs24.50ms__PACKAGE__->meta->add_attribute('parent_registry' => (
# spent 4.39ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 112µs making 1 call to Moose::Meta::TypeConstraint::Registry::meta
17 reader => 'get_parent_registry',
18 writer => 'set_parent_registry',
19 predicate => 'has_parent_registry',
20));
21
22__PACKAGE__->meta->add_attribute('type_constraints' => (
23 reader => 'type_constraints',
24117µs
# spent 10µs within Moose::Meta::TypeConstraint::Registry::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/TypeConstraint/Registry.pm:24] which was called: # once (10µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm
default => sub { {} }
25128µs22.15ms));
# spent 2.06ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 84µs making 1 call to Moose::Meta::TypeConstraint::Registry::meta
26
27
# spent 1.54ms (45µs+1.50) within Moose::Meta::TypeConstraint::Registry::new which was called: # once (45µs+1.50ms) by Moose::Meta::Attribute::BEGIN@20 at line 59 of Moose/Util/TypeConstraints.pm
sub new {
28344µs my $class = shift;
2911.50ms my $self = $class->_new(@_);
# spent 1.50ms making 1 call to Class::MOP::Object::_new
30 return $self;
31}
32
33
# spent 16.7ms (11.2+5.43) within Moose::Meta::TypeConstraint::Registry::has_type_constraint which was called 398 times, avg 42µs/call: # 388 times (11.0ms+5.32ms) by Moose::Util::TypeConstraints::find_type_constraint at line 260 of Moose/Util/TypeConstraints.pm, avg 42µs/call # 10 times (262µs+116µs) by Moose::Util::TypeConstraints::create_parameterized_type_constraint at line 108 of Moose/Util/TypeConstraints.pm, avg 38µs/call
sub has_type_constraint {
3479610.3ms my ($self, $type_name) = @_;
353985.43ms ($type_name and exists $self->type_constraints->{$type_name}) ? 1 : 0
# spent 5.43ms making 398 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 14µs/call
36}
37
38
# spent 11.7ms (8.50+3.22) within Moose::Meta::TypeConstraint::Registry::get_type_constraint which was called 300 times, avg 39µs/call: # 268 times (7.63ms+2.87ms) by Moose::Util::TypeConstraints::find_type_constraint at line 261 of Moose/Util/TypeConstraints.pm, avg 39µs/call # 18 times (493µs+207µs) by Moose::Util::TypeConstraints::_create_type_constraint at line 522 of Moose/Util/TypeConstraints.pm, avg 39µs/call # 10 times (274µs+102µs) by Moose::Util::TypeConstraints::create_parameterized_type_constraint at line 109 of Moose/Util/TypeConstraints.pm, avg 38µs/call # 4 times (99µs+40µs) by Moose::Meta::Attribute::BEGIN@20 at line 850 of Moose/Util/TypeConstraints.pm, avg 35µs/call
sub get_type_constraint {
399007.88ms my ($self, $type_name) = @_;
40 return unless defined $type_name;
413003.22ms $self->type_constraints->{$type_name}
# spent 3.22ms making 300 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 11µs/call
42}
43
44
# spent 16.5ms (10.3+6.22) within Moose::Meta::TypeConstraint::Registry::add_type_constraint which was called 132 times, avg 125µs/call: # 94 times (7.39ms+4.41ms) by Moose::Util::TypeConstraints::register_type_constraint at line 269 of Moose/Util/TypeConstraints.pm, avg 126µs/call # 18 times (1.32ms+830µs) by Moose::Util::TypeConstraints::_create_type_constraint at line 560 of Moose/Util/TypeConstraints.pm, avg 120µs/call # 16 times (1.28ms+802µs) by Moose::Util::TypeConstraints::find_or_parse_type_constraint at line 232 of Moose/Util/TypeConstraints.pm, avg 130µs/call # once (118µs+51µs) by Moose::Meta::Attribute::BEGIN@20 at line 788 of Moose/Util/TypeConstraints.pm # once (73µs+45µs) by Moose::Meta::Attribute::BEGIN@20 at line 847 of Moose/Util/TypeConstraints.pm # once (69µs+43µs) by Moose::Meta::Attribute::BEGIN@20 at line 809 of Moose/Util/TypeConstraints.pm # once (68µs+42µs) by Moose::Meta::Attribute::BEGIN@20 at line 830 of Moose/Util/TypeConstraints.pm
sub add_type_constraint {
453966.01ms my ($self, $type) = @_;
46
4714.84ms3962.93ms unless ( $type && blessed $type && $type->isa('Moose::Meta::TypeConstraint') ) {
# spent 1.11ms making 132 calls to Moose::Meta::TypeConstraint::__ANON__[Moose/Meta/TypeConstraint.pm:10], avg 8µs/call # spent 933µs making 132 calls to Scalar::Util::blessed, avg 7µs/call # spent 882µs making 132 calls to UNIVERSAL::isa, avg 7µs/call
48 require Moose;
49 Moose->throw_error("No type supplied / type is not a valid type constraint");
50 }
51
522643.30ms $self->type_constraints->{$type->name} = $type;
# spent 1.66ms making 132 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 13µs/call # spent 1.64ms making 132 calls to Moose::Meta::TypeConstraint::name, avg 12µs/call
53}
54
55sub find_type_constraint {
56 my ($self, $type_name) = @_;
57 return $self->get_type_constraint($type_name)
58 if $self->has_type_constraint($type_name);
59 return $self->get_parent_registry->find_type_constraint($type_name)
60 if $self->has_parent_registry;
61 return;
62}
63
64163µs1;
65
66__END__