← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 10:04:38 2014
Reported on Tue Jun 24 10:05:07 2014

Filename/usr/local/lib/perl/5.14.2/Moose/Meta/TypeConstraint/Registry.pm
StatementsExecuted 711 statements in 1.62ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
12641429µs559µsMoose::Meta::TypeConstraint::Registry::::get_type_constraintMoose::Meta::TypeConstraint::Registry::get_type_constraint
3572427µs622µsMoose::Meta::TypeConstraint::Registry::::add_type_constraintMoose::Meta::TypeConstraint::Registry::add_type_constraint
10411368µs542µsMoose::Meta::TypeConstraint::Registry::::has_type_constraintMoose::Meta::TypeConstraint::Registry::has_type_constraint
11119µs25µsMoose::Meta::TypeConstraint::Registry::::BEGIN@11Moose::Meta::TypeConstraint::Registry::BEGIN@11
1119µs9µsMoose::Meta::TypeConstraint::Registry::::BEGIN@3Moose::Meta::TypeConstraint::Registry::BEGIN@3
1118µs34µsMoose::Meta::TypeConstraint::Registry::::BEGIN@14Moose::Meta::TypeConstraint::Registry::BEGIN@14
1118µs11µsMoose::Meta::TypeConstraint::Registry::::BEGIN@10Moose::Meta::TypeConstraint::Registry::BEGIN@10
1117µs239µsMoose::Meta::TypeConstraint::Registry::::newMoose::Meta::TypeConstraint::Registry::new
1117µs46µsMoose::Meta::TypeConstraint::Registry::::BEGIN@16Moose::Meta::TypeConstraint::Registry::BEGIN@16
1116µs422µsMoose::Meta::TypeConstraint::Registry::::BEGIN@12Moose::Meta::TypeConstraint::Registry::BEGIN@12
1111µs1µsMoose::Meta::TypeConstraint::Registry::::__ANON__[:27]Moose::Meta::TypeConstraint::Registry::__ANON__[:27]
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
# spent 9µs within Moose::Meta::TypeConstraint::Registry::BEGIN@3 which was called: # once (9µs+0s) by Moose::Util::TypeConstraints::BEGIN@42 at line 5
BEGIN {
419µs $Moose::Meta::TypeConstraint::Registry::AUTHORITY = 'cpan:STEVAN';
5130µs19µs}
6{
721µs $Moose::Meta::TypeConstraint::Registry::VERSION = '2.1005';
8}
9
10234µs214µs
# spent 11µs (8+3) within Moose::Meta::TypeConstraint::Registry::BEGIN@10 which was called: # once (8µs+3µs) by Moose::Util::TypeConstraints::BEGIN@42 at line 10
use strict;
# spent 11µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@10 # spent 3µs making 1 call to strict::import
11222µs230µs
# spent 25µs (19+5) within Moose::Meta::TypeConstraint::Registry::BEGIN@11 which was called: # once (19µs+5µs) by Moose::Util::TypeConstraints::BEGIN@42 at line 11
use warnings;
# spent 25µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@11 # spent 5µs making 1 call to warnings::import
12235µs2837µs
# spent 422µs (6+416) within Moose::Meta::TypeConstraint::Registry::BEGIN@12 which was called: # once (6µs+416µs) by Moose::Util::TypeConstraints::BEGIN@42 at line 12
use metaclass;
# spent 422µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@12 # spent 415µs making 1 call to metaclass::import
13
14226µs261µs
# spent 34µs (8+27) within Moose::Meta::TypeConstraint::Registry::BEGIN@14 which was called: # once (8µs+27µs) by Moose::Util::TypeConstraints::BEGIN@42 at line 14
use Scalar::Util 'blessed';
# spent 34µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@14 # spent 27µs making 1 call to Exporter::import
15
162274µs286µs
# spent 46µs (7+39) within Moose::Meta::TypeConstraint::Registry::BEGIN@16 which was called: # once (7µs+39µs) by Moose::Util::TypeConstraints::BEGIN@42 at line 16
use base 'Class::MOP::Object';
# spent 46µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@16 # spent 39µs making 1 call to base::import
17
1814µs3701µs__PACKAGE__->meta->add_attribute('parent_registry' => (
# spent 678µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 17µs making 1 call to Moose::Meta::TypeConstraint::Registry::meta # spent 6µs making 1 call to Class::MOP::_definition_context
19 reader => 'get_parent_registry',
20 writer => 'set_parent_registry',
21 predicate => 'has_parent_registry',
22 Class::MOP::_definition_context(),
23));
24
25__PACKAGE__->meta->add_attribute('type_constraints' => (
26 reader => 'type_constraints',
2713µs
# spent 1µs within Moose::Meta::TypeConstraint::Registry::__ANON__[/usr/local/lib/perl/5.14.2/Moose/Meta/TypeConstraint/Registry.pm:27] which was called: # once (1µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 49 of Class/MOP/Mixin/AttributeCore.pm
default => sub { {} },
2815µs3324µs Class::MOP::_definition_context(),
# spent 308µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 11µs making 1 call to Moose::Meta::TypeConstraint::Registry::meta # spent 5µs making 1 call to Class::MOP::_definition_context
29));
30
31
# spent 239µs (7+231) within Moose::Meta::TypeConstraint::Registry::new which was called: # once (7µs+231µs) by Moose::Meta::Attribute::BEGIN@24 at line 61 of Moose/Util/TypeConstraints.pm
sub new {
32310µs my $class = shift;
331232µs my $self = $class->_new(@_);
# spent 232µs making 1 call to Class::MOP::Object::_new
34 return $self;
35}
36
37
# spent 542µs (368+174) within Moose::Meta::TypeConstraint::Registry::has_type_constraint which was called 104 times, avg 5µs/call: # 104 times (368µs+174µs) by Moose::Util::TypeConstraints::find_type_constraint at line 316 of Moose/Util/TypeConstraints.pm, avg 5µs/call
sub has_type_constraint {
38208353µs my ($self, $type_name) = @_;
39104174µs ($type_name and exists $self->type_constraints->{$type_name}) ? 1 : 0
# spent 174µs making 104 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 2µs/call
40}
41
42
# spent 559µs (429+130) within Moose::Meta::TypeConstraint::Registry::get_type_constraint which was called 126 times, avg 4µs/call: # 92 times (304µs+89µs) by Moose::Util::TypeConstraints::find_type_constraint at line 317 of Moose/Util/TypeConstraints.pm, avg 4µs/call # 19 times (74µs+25µs) by Moose::Util::TypeConstraints::_create_type_constraint at line 539 of Moose/Util/TypeConstraints.pm, avg 5µs/call # 11 times (38µs+12µs) by Moose::Util::TypeConstraints::create_class_type_constraint at line 166 of Moose/Util/TypeConstraints.pm, avg 4µs/call # 4 times (13µs+4µs) by Moose::Meta::Attribute::BEGIN@24 at line 730 of Moose/Util/TypeConstraints.pm, avg 4µs/call
sub get_type_constraint {
43378378µs my ($self, $type_name) = @_;
44 return unless defined $type_name;
45126130µs $self->type_constraints->{$type_name}
# spent 130µs making 126 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 1µs/call
46}
47
48
# spent 622µs (427+196) within Moose::Meta::TypeConstraint::Registry::add_type_constraint which was called 35 times, avg 18µs/call: # 19 times (228µs+103µs) by Moose::Util::TypeConstraints::_create_type_constraint at line 578 of Moose/Util/TypeConstraints.pm, avg 17µs/call # 11 times (137µs+65µs) by Moose::Util::TypeConstraints::create_class_type_constraint at line 189 of Moose/Util/TypeConstraints.pm, avg 18µs/call # once (14µs+6µs) by Moose::Util::TypeConstraints::find_or_parse_type_constraint at line 288 of Moose/Util/TypeConstraints.pm # once (14µs+6µs) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 204 of Moose/Util/TypeConstraints/Builtins.pm # once (11µs+6µs) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 300 of Moose/Util/TypeConstraints/Builtins.pm # once (11µs+5µs) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 239 of Moose/Util/TypeConstraints/Builtins.pm # once (11µs+5µs) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 274 of Moose/Util/TypeConstraints/Builtins.pm
sub add_type_constraint {
49105219µs my ($self, $type) = @_;
50
511206µs10597µs unless ( $type && blessed $type && $type->isa('Moose::Meta::TypeConstraint') ) {
# spent 34µs making 35 calls to UNIVERSAL::isa, avg 974ns/call # spent 32µs making 35 calls to Moose::Meta::TypeConstraint::__ANON__[Moose/Meta/TypeConstraint.pm:16], avg 914ns/call # spent 31µs making 35 calls to Scalar::Util::blessed, avg 883ns/call
52 require Moose;
53 Moose->throw_error("No type supplied / type is not a valid type constraint");
54 }
55
567099µs $self->type_constraints->{$type->name} = $type;
# spent 53µs making 35 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 2µs/call # spent 46µs making 35 calls to Moose::Meta::TypeConstraint::name, avg 1µs/call
57}
58
59sub find_type_constraint {
60 my ($self, $type_name) = @_;
61 return $self->get_type_constraint($type_name)
62 if $self->has_type_constraint($type_name);
63 return $self->get_parent_registry->find_type_constraint($type_name)
64 if $self->has_parent_registry;
65 return;
66}
67
6817µs1;
69
70# ABSTRACT: registry for type constraints
71
72__END__