← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/pan_genome_post_analysis
  Run on Fri Mar 27 11:43:32 2015
Reported on Fri Mar 27 11:45:26 2015

Filename/Users/ap13/perl5/lib/perl5/darwin-2level/Moose/Meta/TypeConstraint/Registry.pm
StatementsExecuted 1491 statements in 3.34ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
254211.35ms1.95msMoose::Meta::TypeConstraint::Registry::::has_type_constraintMoose::Meta::TypeConstraint::Registry::has_type_constraint
273611.22ms1.55msMoose::Meta::TypeConstraint::Registry::::get_type_constraintMoose::Meta::TypeConstraint::Registry::get_type_constraint
4882712µs1.05msMoose::Meta::TypeConstraint::Registry::::add_type_constraintMoose::Meta::TypeConstraint::Registry::add_type_constraint
11116µs330µsMoose::Meta::TypeConstraint::Registry::::newMoose::Meta::TypeConstraint::Registry::new
11114µs29µsMoose::Meta::TypeConstraint::Registry::::BEGIN@4Moose::Meta::TypeConstraint::Registry::BEGIN@4
1119µs32µsMoose::Meta::TypeConstraint::Registry::::BEGIN@8Moose::Meta::TypeConstraint::Registry::BEGIN@8
1118µs154µsMoose::Meta::TypeConstraint::Registry::::BEGIN@12Moose::Meta::TypeConstraint::Registry::BEGIN@12
1118µs13µsMoose::Meta::TypeConstraint::Registry::::BEGIN@5Moose::Meta::TypeConstraint::Registry::BEGIN@5
1117µs28µsMoose::Meta::TypeConstraint::Registry::::BEGIN@10Moose::Meta::TypeConstraint::Registry::BEGIN@10
1116µs462µsMoose::Meta::TypeConstraint::Registry::::BEGIN@6Moose::Meta::TypeConstraint::Registry::BEGIN@6
1112µs2µsMoose::Meta::TypeConstraint::Registry::::__ANON__[:23]Moose::Meta::TypeConstraint::Registry::__ANON__[:23]
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
1package Moose::Meta::TypeConstraint::Registry;
21700nsour $VERSION = '2.1403';
3
4222µs243µs
# spent 29µs (14+14) within Moose::Meta::TypeConstraint::Registry::BEGIN@4 which was called: # once (14µs+14µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 4
use strict;
# spent 29µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@4 # spent 14µs making 1 call to strict::import
5219µs218µs
# spent 13µs (8+5) within Moose::Meta::TypeConstraint::Registry::BEGIN@5 which was called: # once (8µs+5µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 5
use warnings;
# spent 13µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@5 # spent 5µs making 1 call to warnings::import
6226µs2918µs
# spent 462µs (6+456) within Moose::Meta::TypeConstraint::Registry::BEGIN@6 which was called: # once (6µs+456µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 6
use metaclass;
# spent 462µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@6 # spent 456µs making 1 call to metaclass::import
7
8225µs254µs
# spent 32µs (9+23) within Moose::Meta::TypeConstraint::Registry::BEGIN@8 which was called: # once (9µs+23µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 8
use Scalar::Util 'blessed';
# spent 32µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@8 # spent 23µs making 1 call to Exporter::import
9
10224µs250µs
# spent 28µs (7+21) within Moose::Meta::TypeConstraint::Registry::BEGIN@10 which was called: # once (7µs+21µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 10
use parent 'Class::MOP::Object';
# spent 28µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@10 # spent 21µs making 1 call to parent::import
11
122296µs2301µs
# spent 154µs (8+146) within Moose::Meta::TypeConstraint::Registry::BEGIN@12 which was called: # once (8µs+146µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 12
use Moose::Util 'throw_exception';
# spent 154µs making 1 call to Moose::Meta::TypeConstraint::Registry::BEGIN@12 # spent 146µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
13
1416µs3710µs__PACKAGE__->meta->add_attribute('parent_registry' => (
# spent 687µ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
15 reader => 'get_parent_registry',
16 writer => 'set_parent_registry',
17 predicate => 'has_parent_registry',
18 Class::MOP::_definition_context(),
19));
20
21__PACKAGE__->meta->add_attribute('type_constraints' => (
22 reader => 'type_constraints',
2314µs
# spent 2µs within Moose::Meta::TypeConstraint::Registry::__ANON__[/Users/ap13/perl5/lib/perl5/darwin-2level/Moose/Meta/TypeConstraint/Registry.pm:23] which was called: # once (2µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 40 of Class/MOP/Mixin/AttributeCore.pm
default => sub { {} },
2416µs3323µs Class::MOP::_definition_context(),
# spent 307µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 10µs making 1 call to Moose::Meta::TypeConstraint::Registry::meta # spent 5µs making 1 call to Class::MOP::_definition_context
25));
26
27
# spent 330µs (16+315) within Moose::Meta::TypeConstraint::Registry::new which was called: # once (16µs+315µs) by Moose::Meta::Attribute::BEGIN@16 at line 55 of Moose/Util/TypeConstraints.pm
sub new {
28311µs my $class = shift;
291315µs my $self = $class->_new(@_);
# spent 315µs making 1 call to Class::MOP::Object::_new
30 return $self;
31}
32
33
# spent 1.95ms (1.35+599µs) within Moose::Meta::TypeConstraint::Registry::has_type_constraint which was called 254 times, avg 8µs/call: # 252 times (1.34ms+596µs) by Moose::Util::TypeConstraints::find_type_constraint at line 302 of Moose/Util/TypeConstraints.pm, avg 8µs/call # 2 times (9µs+3µs) by Moose::Util::TypeConstraints::create_parameterized_type_constraint at line 119 of Moose/Util/TypeConstraints.pm, avg 6µs/call
sub has_type_constraint {
345081.17ms my ($self, $type_name) = @_;
35254599µs ($type_name and exists $self->type_constraints->{$type_name}) ? 1 : 0
# spent 599µs making 254 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 2µs/call
36}
37
38
# spent 1.55ms (1.22+328µs) within Moose::Meta::TypeConstraint::Registry::get_type_constraint which was called 273 times, avg 6µs/call: # 225 times (982µs+266µs) by Moose::Util::TypeConstraints::find_type_constraint at line 303 of Moose/Util/TypeConstraints.pm, avg 6µs/call # 22 times (133µs+29µs) by Moose::Util::TypeConstraints::create_class_type_constraint at line 156 of Moose/Util/TypeConstraints.pm, avg 7µs/call # 17 times (67µs+24µs) by Moose::Util::TypeConstraints::_create_type_constraint at line 549 of Moose/Util/TypeConstraints.pm, avg 5µs/call # 4 times (13µs+4µs) by Moose::Meta::Attribute::BEGIN@16 at line 735 of Moose/Util/TypeConstraints.pm, avg 4µs/call # 3 times (17µs+4µs) by Moose::Util::TypeConstraints::create_role_type_constraint at line 190 of Moose/Util/TypeConstraints.pm, avg 7µs/call # 2 times (9µs+2µs) by Moose::Util::TypeConstraints::create_parameterized_type_constraint at line 120 of Moose/Util/TypeConstraints.pm, avg 6µs/call
sub get_type_constraint {
398191.02ms my ($self, $type_name) = @_;
40 return unless defined $type_name;
41273328µs $self->type_constraints->{$type_name}
# spent 328µs making 273 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 1µs/call
42}
43
44
# spent 1.05ms (712µs+337µs) within Moose::Meta::TypeConstraint::Registry::add_type_constraint which was called 48 times, avg 22µs/call: # 22 times (376µs+186µs) by Moose::Util::TypeConstraints::create_class_type_constraint at line 177 of Moose/Util/TypeConstraints.pm, avg 26µs/call # 17 times (202µs+94µs) by Moose::Util::TypeConstraints::_create_type_constraint at line 585 of Moose/Util/TypeConstraints.pm, avg 17µs/call # 3 times (51µs+22µs) by Moose::Util::TypeConstraints::create_role_type_constraint at line 211 of Moose/Util/TypeConstraints.pm, avg 24µs/call # 2 times (35µs+12µs) by Moose::Util::TypeConstraints::find_or_parse_type_constraint at line 274 of Moose/Util/TypeConstraints.pm, avg 23µs/call # once (15µs+6µs) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 198 of Moose/Util/TypeConstraints/Builtins.pm # once (11µs+6µs) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 294 of Moose/Util/TypeConstraints/Builtins.pm # once (11µs+5µs) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 268 of Moose/Util/TypeConstraints/Builtins.pm # once (11µs+5µs) by Moose::Util::TypeConstraints::Builtins::define_builtins at line 233 of Moose/Util/TypeConstraints/Builtins.pm
sub add_type_constraint {
45144355µs my ($self, $type) = @_;
46
471345µs144187µs unless ( $type && blessed $type && $type->isa('Moose::Meta::TypeConstraint') ) {
# spent 76µs making 48 calls to Moose::Meta::TypeConstraint::__ANON__[Moose/Meta/TypeConstraint.pm:10], avg 2µs/call # spent 60µs making 48 calls to Scalar::Util::blessed, avg 1µs/call # spent 51µs making 48 calls to UNIVERSAL::isa, avg 1µs/call
48 throw_exception( InvalidTypeConstraint => registry_object => $self,
49 type => $type
50 );
51 }
52
5396150µs $self->type_constraints->{$type->name} = $type;
# spent 75µs making 48 calls to Moose::Meta::TypeConstraint::Registry::type_constraints, avg 2µs/call # spent 74µs making 48 calls to Moose::Meta::TypeConstraint::name, avg 2µs/call
54}
55
56sub find_type_constraint {
57 my ($self, $type_name) = @_;
58 return $self->get_type_constraint($type_name)
59 if $self->has_type_constraint($type_name);
60 return $self->get_parent_registry->find_type_constraint($type_name)
61 if $self->has_parent_registry;
62 return;
63}
64
65110µs1;
66
67# ABSTRACT: registry for type constraints
68
69__END__