← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 09:58:41 2014
Reported on Tue Jun 24 09:59:13 2014

Filename/usr/local/lib/perl/5.14.2/Moose/Meta/TypeConstraint/Registry.pm
StatementsExecuted 711 statements in 1.59ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
12641435µs563µsMoose::Meta::TypeConstraint::Registry::::get_type_constraintMoose::Meta::TypeConstraint::Registry::get_type_constraint
3572414µs622µsMoose::Meta::TypeConstraint::Registry::::add_type_constraintMoose::Meta::TypeConstraint::Registry::add_type_constraint
10411372µs529µsMoose::Meta::TypeConstraint::Registry::::has_type_constraintMoose::Meta::TypeConstraint::Registry::has_type_constraint
11110µs13µsMoose::Meta::TypeConstraint::Registry::::BEGIN@10Moose::Meta::TypeConstraint::Registry::BEGIN@10
1118µs8µsMoose::Meta::TypeConstraint::Registry::::BEGIN@3Moose::Meta::TypeConstraint::Registry::BEGIN@3
1117µs33µsMoose::Meta::TypeConstraint::Registry::::BEGIN@14Moose::Meta::TypeConstraint::Registry::BEGIN@14
1117µs45µsMoose::Meta::TypeConstraint::Registry::::BEGIN@16Moose::Meta::TypeConstraint::Registry::BEGIN@16
1117µs216µsMoose::Meta::TypeConstraint::Registry::::newMoose::Meta::TypeConstraint::Registry::new
1116µs12µsMoose::Meta::TypeConstraint::Registry::::BEGIN@11Moose::Meta::TypeConstraint::Registry::BEGIN@11
1116µs407µ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 8µs within Moose::Meta::TypeConstraint::Registry::BEGIN@3 which was called: # once (8µs+0s) by Moose::Util::TypeConstraints::BEGIN@42 at line 5
BEGIN {
418µs $Moose::Meta::TypeConstraint::Registry::AUTHORITY = 'cpan:STEVAN';
5131µs18µs}
6{
721µs $Moose::Meta::TypeConstraint::Registry::VERSION = '2.1005';
8}
9
10222µs216µs
# spent 13µs (10+3) within Moose::Meta::TypeConstraint::Registry::BEGIN@10 which was called: # once (10µs+3µs) by Moose::Util::TypeConstraints::BEGIN@42 at line 10
use strict;
# spent 13µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@10 # spent 3µs making 1 call to strict::import
11220µs217µs
# spent 12µs (6+5) within Moose::Meta::TypeConstraint::Registry::BEGIN@11 which was called: # once (6µs+5µs) by Moose::Util::TypeConstraints::BEGIN@42 at line 11
use warnings;
# spent 12µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@11 # spent 5µs making 1 call to warnings::import
12229µs2809µs
# spent 407µs (6+401) within Moose::Meta::TypeConstraint::Registry::BEGIN@12 which was called: # once (6µs+401µs) by Moose::Util::TypeConstraints::BEGIN@42 at line 12
use metaclass;
# spent 407µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@12 # spent 401µs making 1 call to metaclass::import
13
14226µs260µs
# spent 33µs (7+26) within Moose::Meta::TypeConstraint::Registry::BEGIN@14 which was called: # once (7µs+26µs) by Moose::Util::TypeConstraints::BEGIN@42 at line 14
use Scalar::Util 'blessed';
# spent 33µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@14 # spent 26µs making 1 call to Exporter::import
15
162270µs284µs
# spent 45µs (7+38) within Moose::Meta::TypeConstraint::Registry::BEGIN@16 which was called: # once (7µs+38µs) by Moose::Util::TypeConstraints::BEGIN@42 at line 16
use base 'Class::MOP::Object';
# spent 45µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@16 # spent 38µs making 1 call to base::import
17
1814µs3739µs__PACKAGE__->meta->add_attribute('parent_registry' => (
# spent 716µ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µs3323µs Class::MOP::_definition_context(),
# spent 307µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 11µs making 1 call to Moose::Meta::TypeConstraint::Registry::meta # spent 6µs making 1 call to Class::MOP::_definition_context
29));
30
31
# spent 216µs (7+210) within Moose::Meta::TypeConstraint::Registry::new which was called: # once (7µs+210µs) by Moose::Meta::Attribute::BEGIN@24 at line 61 of Moose/Util/TypeConstraints.pm
sub new {
3236µs my $class = shift;
331210µs my $self = $class->_new(@_);
# spent 210µs making 1 call to Class::MOP::Object::_new
34 return $self;
35}
36
37
# spent 529µs (372+156) within Moose::Meta::TypeConstraint::Registry::has_type_constraint which was called 104 times, avg 5µs/call: # 104 times (372µs+156µs) by Moose::Util::TypeConstraints::find_type_constraint at line 316 of Moose/Util/TypeConstraints.pm, avg 5µs/call
sub has_type_constraint {
38208365µs my ($self, $type_name) = @_;
39104156µs ($type_name and exists $self->type_constraints->{$type_name}) ? 1 : 0
# spent 156µs making 104 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 2µs/call
40}
41
42
# spent 563µs (435+128) within Moose::Meta::TypeConstraint::Registry::get_type_constraint which was called 126 times, avg 4µs/call: # 92 times (300µs+88µs) by Moose::Util::TypeConstraints::find_type_constraint at line 317 of Moose/Util/TypeConstraints.pm, avg 4µs/call # 19 times (86µs+25µs) by Moose::Util::TypeConstraints::_create_type_constraint at line 539 of Moose/Util/TypeConstraints.pm, avg 6µs/call # 11 times (37µ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 (12µ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;
45126128µs $self->type_constraints->{$type_name}
# spent 128µs making 126 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 1µs/call
46}
47
48
# spent 622µs (414+209) within Moose::Meta::TypeConstraint::Registry::add_type_constraint which was called 35 times, avg 18µs/call: # 19 times (222µs+117µs) by Moose::Util::TypeConstraints::_create_type_constraint at line 578 of Moose/Util/TypeConstraints.pm, avg 18µs/call # 11 times (131µs+64µs) by Moose::Util::TypeConstraints::create_class_type_constraint at line 189 of Moose/Util/TypeConstraints.pm, avg 18µs/call # once (14µs+5µs) by Moose::Util::TypeConstraints::find_or_parse_type_constraint at line 288 of Moose/Util/TypeConstraints.pm # once (13µ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 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 # once (11µs+5µs) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 300 of Moose/Util/TypeConstraints/Builtins.pm
sub add_type_constraint {
49105209µs my ($self, $type) = @_;
50
511203µs10599µs unless ( $type && blessed $type && $type->isa('Moose::Meta::TypeConstraint') ) {
# spent 33µs making 35 calls to UNIVERSAL::isa, avg 954ns/call # spent 33µs making 35 calls to Moose::Meta::TypeConstraint::__ANON__[Moose/Meta/TypeConstraint.pm:16], avg 946ns/call # spent 32µs making 35 calls to Scalar::Util::blessed, avg 917ns/call
52 require Moose;
53 Moose->throw_error("No type supplied / type is not a valid type constraint");
54 }
55
5670110µs $self->type_constraints->{$type->name} = $type;
# spent 58µs making 35 calls to Moose::Meta::TypeConstraint::name, avg 2µs/call # spent 52µs making 35 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, 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__