← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:45:08 2010
Reported on Wed Nov 17 22:11:08 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 5380 statements in 62.6ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
10471127.4ms40.1msMoose::Meta::TypeConstraint::Registry::::has_type_constraintMoose::Meta::TypeConstraint::Registry::has_type_constraint
9283125.0ms35.4msMoose::Meta::TypeConstraint::Registry::::get_type_constraintMoose::Meta::TypeConstraint::Registry::get_type_constraint
1596112.2ms19.7msMoose::Meta::TypeConstraint::Registry::::add_type_constraintMoose::Meta::TypeConstraint::Registry::add_type_constraint
11173µs90µsMoose::Meta::TypeConstraint::Registry::::BEGIN@4Moose::Meta::TypeConstraint::Registry::BEGIN@4
11159µs1.58msMoose::Meta::TypeConstraint::Registry::::newMoose::Meta::TypeConstraint::Registry::new
11142µs227µsMoose::Meta::TypeConstraint::Registry::::BEGIN@8Moose::Meta::TypeConstraint::Registry::BEGIN@8
11141µs287µsMoose::Meta::TypeConstraint::Registry::::BEGIN@14Moose::Meta::TypeConstraint::Registry::BEGIN@14
11138µs107µsMoose::Meta::TypeConstraint::Registry::::BEGIN@5Moose::Meta::TypeConstraint::Registry::BEGIN@5
11137µs3.03msMoose::Meta::TypeConstraint::Registry::::BEGIN@6Moose::Meta::TypeConstraint::Registry::BEGIN@6
11111µs11µ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µs2108µs
# spent 90µs (73+18) within Moose::Meta::TypeConstraint::Registry::BEGIN@4 which was called: # once (73µs+18µs) by Moose::Util::TypeConstraints::BEGIN@39 at line 4
use strict;
# spent 90µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@4 # spent 18µs making 1 call to strict::import
5395µs2175µs
# spent 107µs (38+69) within Moose::Meta::TypeConstraint::Registry::BEGIN@5 which was called: # once (38µs+69µ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 69µs making 1 call to warnings::import
63149µs26.02ms
# spent 3.03ms (37µs+2.99) within Moose::Meta::TypeConstraint::Registry::BEGIN@6 which was called: # once (37µs+2.99ms) by Moose::Util::TypeConstraints::BEGIN@39 at line 6
use metaclass;
# spent 3.03ms making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@6 # spent 2.99ms making 1 call to metaclass::import
7
83233µs2412µs
# spent 227µs (42+185) within Moose::Meta::TypeConstraint::Registry::BEGIN@8 which was called: # once (42µs+185µs) by Moose::Util::TypeConstraints::BEGIN@39 at line 8
use Scalar::Util 'blessed';
# spent 227µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@8 # spent 185µs making 1 call to Exporter::import
9
1015µsour $VERSION = '1.19';
11169µs$VERSION = eval $VERSION;
# spent 10µs executing statements in string eval
1213µsour $AUTHORITY = 'cpan:STEVAN';
13
1431.04ms2533µs
# spent 287µs (41+246) within Moose::Meta::TypeConstraint::Registry::BEGIN@14 which was called: # once (41µs+246µs) by Moose::Util::TypeConstraints::BEGIN@39 at line 14
use base 'Class::MOP::Object';
# spent 287µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@14 # spent 246µs making 1 call to base::import
15
16127µs24.30ms__PACKAGE__->meta->add_attribute('parent_registry' => (
# spent 4.19ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 115µ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',
24118µs
# spent 11µ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 (11µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm
default => sub { {} }
25131µs22.26ms));
# spent 2.18ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 87µs making 1 call to Moose::Meta::TypeConstraint::Registry::meta
26
27
# spent 1.58ms (59µs+1.52) within Moose::Meta::TypeConstraint::Registry::new which was called: # once (59µs+1.52ms) by Moose::Meta::Attribute::BEGIN@20 at line 59 of Moose/Util/TypeConstraints.pm
sub new {
28344µs my $class = shift;
2911.52ms my $self = $class->_new(@_);
# spent 1.52ms making 1 call to Class::MOP::Object::_new
30 return $self;
31}
32
33
# spent 40.1ms (27.4+12.6) within Moose::Meta::TypeConstraint::Registry::has_type_constraint which was called 1047 times, avg 38µs/call: # 1047 times (27.4ms+12.6ms) by Moose::Util::TypeConstraints::find_type_constraint at line 260 of Moose/Util/TypeConstraints.pm, avg 38µs/call
sub has_type_constraint {
34209425.3ms my ($self, $type_name) = @_;
35104712.6ms ($type_name and exists $self->type_constraints->{$type_name}) ? 1 : 0
# spent 12.6ms making 1047 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 12µs/call
36}
37
38
# spent 35.4ms (25.0+10.3) within Moose::Meta::TypeConstraint::Registry::get_type_constraint which was called 928 times, avg 38µs/call: # 898 times (24.1ms+9.17ms) by Moose::Util::TypeConstraints::find_type_constraint at line 261 of Moose/Util/TypeConstraints.pm, avg 37µs/call # 26 times (839µs+1.13ms) by Moose::Util::TypeConstraints::_create_type_constraint at line 522 of Moose/Util/TypeConstraints.pm, avg 76µs/call # 4 times (100µs+39µs) by Moose::Meta::Attribute::BEGIN@20 at line 850 of Moose/Util/TypeConstraints.pm, avg 35µs/call
sub get_type_constraint {
39278422.5ms my ($self, $type_name) = @_;
40 return unless defined $type_name;
411104µs93610.3ms $self->type_constraints->{$type_name}
# spent 9.51ms making 928 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 10µs/call # spent 827µs making 8 calls to MooseX::Types::TypeDecorator::__ANON__[MooseX/Types/TypeDecorator.pm:26], avg 103µs/call
42}
43
44
# spent 19.7ms (12.2+7.49) within Moose::Meta::TypeConstraint::Registry::add_type_constraint which was called 159 times, avg 124µs/call: # 129 times (9.90ms+6.14ms) by Moose::Util::TypeConstraints::register_type_constraint at line 269 of Moose/Util/TypeConstraints.pm, avg 124µs/call # 26 times (1.94ms+1.18ms) by Moose::Util::TypeConstraints::_create_type_constraint at line 560 of Moose/Util/TypeConstraints.pm, avg 120µs/call # once (96µs+44µs) by Moose::Meta::Attribute::BEGIN@20 at line 847 of Moose/Util/TypeConstraints.pm # once (91µs+48µs) by Moose::Meta::Attribute::BEGIN@20 at line 788 of Moose/Util/TypeConstraints.pm # once (69µs+42µs) by Moose::Meta::Attribute::BEGIN@20 at line 809 of Moose/Util/TypeConstraints.pm # once (67µs+41µs) by Moose::Meta::Attribute::BEGIN@20 at line 830 of Moose/Util/TypeConstraints.pm
sub add_type_constraint {
454777.12ms my ($self, $type) = @_;
46
4715.77ms4773.61ms unless ( $type && blessed $type && $type->isa('Moose::Meta::TypeConstraint') ) {
# spent 1.35ms making 159 calls to Moose::Meta::TypeConstraint::__ANON__[Moose/Meta/TypeConstraint.pm:10], avg 8µs/call # spent 1.16ms making 159 calls to Scalar::Util::blessed, avg 7µs/call # spent 1.10ms making 159 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
52115µs3193.88ms $self->type_constraints->{$type->name} = $type;
# spent 1.92ms making 159 calls to Moose::Meta::TypeConstraint::name, avg 12µs/call # spent 1.87ms making 159 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 12µs/call # spent 89µs making 1 call to MooseX::Types::TypeDecorator::__ANON__[MooseX/Types/TypeDecorator.pm:26]
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
64144µs1;
65
66__END__