← 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/Parameterized.pm
StatementsExecuted 112 statements in 1.15ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111674µs2.55msMoose::Meta::TypeConstraint::Parameterized::::BEGIN@10Moose::Meta::TypeConstraint::Parameterized::BEGIN@10
1643221µs577µsMoose::Meta::TypeConstraint::Parameterized::::can_be_inlinedMoose::Meta::TypeConstraint::Parameterized::can_be_inlined
1033192µs518µsMoose::Meta::TypeConstraint::Parameterized::::inline_environmentMoose::Meta::TypeConstraint::Parameterized::inline_environment
211109µs2.14msMoose::Meta::TypeConstraint::Parameterized::::compile_type_constraintMoose::Meta::TypeConstraint::Parameterized::compile_type_constraint
62273µs704µsMoose::Meta::TypeConstraint::Parameterized::::_inline_checkMoose::Meta::TypeConstraint::Parameterized::_inline_check
11115µs30µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@4Moose::Meta::TypeConstraint::Parameterized::BEGIN@4
11110µs40µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@13Moose::Meta::TypeConstraint::Parameterized::BEGIN@13
11110µs185µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@11Moose::Meta::TypeConstraint::Parameterized::BEGIN@11
11110µs41µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@8Moose::Meta::TypeConstraint::Parameterized::BEGIN@8
1119µs9µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@9Moose::Meta::TypeConstraint::Parameterized::BEGIN@9
1119µs14µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@5Moose::Meta::TypeConstraint::Parameterized::BEGIN@5
1118µs495µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@6Moose::Meta::TypeConstraint::Parameterized::BEGIN@6
0000s0sMoose::Meta::TypeConstraint::Parameterized::::create_child_typeMoose::Meta::TypeConstraint::Parameterized::create_child_type
0000s0sMoose::Meta::TypeConstraint::Parameterized::::equalsMoose::Meta::TypeConstraint::Parameterized::equals
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::Parameterized;
21600nsour $VERSION = '2.1403';
3
4226µs245µs
# spent 30µs (15+15) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@4 which was called: # once (15µs+15µs) by Moose::Util::TypeConstraints::BEGIN@26 at line 4
use strict;
# spent 30µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@4 # spent 15µs making 1 call to strict::import
5222µs219µs
# spent 14µs (9+5) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@5 which was called: # once (9µs+5µs) by Moose::Util::TypeConstraints::BEGIN@26 at line 5
use warnings;
# spent 14µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@5 # spent 5µs making 1 call to warnings::import
6228µs2982µs
# spent 495µs (8+487) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@6 which was called: # once (8µs+487µs) by Moose::Util::TypeConstraints::BEGIN@26 at line 6
use metaclass;
# spent 495µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@6 # spent 487µs making 1 call to metaclass::import
7
8226µs272µs
# spent 41µs (10+31) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@8 which was called: # once (10µs+31µs) by Moose::Util::TypeConstraints::BEGIN@26 at line 8
use Scalar::Util 'blessed';
# spent 41µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@8 # spent 31µs making 1 call to Exporter::import
9226µs19µs
# spent 9µs within Moose::Meta::TypeConstraint::Parameterized::BEGIN@9 which was called: # once (9µs+0s) by Moose::Util::TypeConstraints::BEGIN@26 at line 9
use Moose::Util::TypeConstraints;
102138µs12.55ms
# spent 2.55ms (674µs+1.87) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@10 which was called: # once (674µs+1.87ms) by Moose::Util::TypeConstraints::BEGIN@26 at line 10
use Moose::Meta::TypeConstraint::Parameterizable;
11233µs2359µs
# spent 185µs (10+175) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@11 which was called: # once (10µs+175µs) by Moose::Util::TypeConstraints::BEGIN@26 at line 11
use Moose::Util 'throw_exception';
# spent 185µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@11 # spent 175µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
12
132407µs270µs
# spent 40µs (10+30) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@13 which was called: # once (10µs+30µs) by Moose::Util::TypeConstraints::BEGIN@26 at line 13
use parent 'Moose::Meta::TypeConstraint';
# spent 40µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@13 # spent 30µs making 1 call to parent::import
14
1516µs3576µs__PACKAGE__->meta->add_attribute('type_parameter' => (
# spent 551µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 19µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::meta # spent 6µs making 1 call to Class::MOP::_definition_context
16 accessor => 'type_parameter',
17 predicate => 'has_type_parameter',
18 Class::MOP::_definition_context(),
19));
20
2114µs3472µs__PACKAGE__->meta->add_attribute('parameterized_from' => (
# spent 456µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 10µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::meta # spent 5µs making 1 call to Class::MOP::_definition_context
22 accessor => 'parameterized_from',
23 predicate => 'has_parameterized_from',
24 Class::MOP::_definition_context(),
25));
26
27sub equals {
28 my ( $self, $type_or_name ) = @_;
29
30 my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name);
31
32 return unless $other->isa(__PACKAGE__);
33
34 return (
35 $self->type_parameter->equals( $other->type_parameter )
36 and
37 $self->parent->equals( $other->parent )
38 );
39}
40
41
# spent 2.14ms (109µs+2.03) within Moose::Meta::TypeConstraint::Parameterized::compile_type_constraint which was called 2 times, avg 1.07ms/call: # 2 times (109µs+2.03ms) by Moose::Meta::TypeConstraint::new at line 125 of Moose/Meta/TypeConstraint.pm, avg 1.07ms/call
sub compile_type_constraint {
422286µs my $self = shift;
43
4425µs unless ( $self->has_type_parameter ) {
# spent 5µs making 2 calls to Moose::Meta::TypeConstraint::Parameterized::has_type_parameter, avg 3µs/call
45 throw_exception( CannotCreateHigherOrderTypeWithoutATypeParameter => type_name => $self->name );
46 }
47
4825µs my $type_parameter = $self->type_parameter;
# spent 5µs making 2 calls to Moose::Meta::TypeConstraint::Parameterized::type_parameter, avg 3µs/call
49
5045µs unless ( blessed $type_parameter && $type_parameter->isa('Moose::Meta::TypeConstraint') ) {
# spent 3µs making 2 calls to Scalar::Util::blessed, avg 2µs/call # spent 2µs making 2 calls to UNIVERSAL::isa, avg 750ns/call
51 throw_exception( TypeParameterMustBeMooseMetaType => type_name => $self->name );
52 }
53
5424µs foreach my $type (Moose::Util::TypeConstraints::get_all_parameterizable_types()) {
# spent 4µs making 2 calls to Moose::Util::TypeConstraints::get_all_parameterizable_types, avg 2µs/call
5581.23ms if (my $constraint = $type->generate_constraint_for($self)) {
# spent 1.23ms making 8 calls to Moose::Meta::TypeConstraint::Parameterizable::generate_constraint_for, avg 154µs/call
5625µs $self->_set_constraint($constraint);
# spent 5µs making 2 calls to Moose::Meta::TypeConstraint::_set_constraint, avg 3µs/call
572779µs return $self->SUPER::compile_type_constraint;
# spent 779µs making 2 calls to Moose::Meta::TypeConstraint::compile_type_constraint, avg 390µs/call
58 }
59 }
60
61 # if we get here, then we couldn't
62 # find a way to parameterize this type
63 throw_exception( TypeConstraintCannotBeUsedForAParameterizableType => type_name => $self->name,
64 parent_type_name => $self->parent->name,
65 );
66}
67
68
# spent 577µs (221+356) within Moose::Meta::TypeConstraint::Parameterized::can_be_inlined which was called 16 times, avg 36µs/call: # 6 times (59µs+95µs) by Moose::Meta::TypeConstraint::Parameterized::_inline_check at line 93, avg 26µs/call # 4 times (65µs+125µs) by Moose::Meta::Attribute::_eval_environment at line 766 of Moose/Meta/Attribute.pm, avg 48µs/call # 4 times (63µs+94µs) by Moose::Meta::Attribute::_inline_check_constraint at line 686 of Moose/Meta/Attribute.pm, avg 39µs/call # 2 times (34µs+43µs) by Moose::Meta::TypeConstraint::_actually_compile_type_constraint at line 285 of Moose/Meta/TypeConstraint.pm, avg 38µs/call
sub can_be_inlined {
6932166µs my $self = shift;
70
71 return
7280356µs $self->has_parameterized_from
# spent 221µs making 16 calls to Moose::Meta::TypeConstraint::can_be_inlined, avg 14µs/call # spent 38µs making 16 calls to Moose::Meta::TypeConstraint::Parameterized::has_parameterized_from, avg 2µs/call # spent 34µs making 16 calls to Moose::Meta::TypeConstraint::Parameterizable::has_inline_generator, avg 2µs/call # spent 32µs making 16 calls to Moose::Meta::TypeConstraint::Parameterized::parameterized_from, avg 2µs/call # spent 32µs making 16 calls to Moose::Meta::TypeConstraint::Parameterized::type_parameter, avg 2µs/call
73 && $self->parameterized_from->has_inline_generator
74 && $self->type_parameter->can_be_inlined;
75}
76
77
# spent 518µs (192+326) within Moose::Meta::TypeConstraint::Parameterized::inline_environment which was called 10 times, avg 52µs/call: # 4 times (84µs+139µs) by Moose::Meta::Class::_eval_environment at line 535 of Moose/Meta/Class.pm, avg 56µs/call # 4 times (71µs+132µs) by Moose::Meta::Attribute::_eval_environment at line 777 of Moose/Meta/Attribute.pm, avg 51µs/call # 2 times (36µs+55µs) by Moose::Meta::TypeConstraint::_actually_compile_type_constraint at line 285 of Moose/Meta/TypeConstraint.pm, avg 46µs/call
sub inline_environment {
7820125µs my $self = shift;
79
80 return {
81 ($self->has_parameterized_from
82 ? (%{ $self->parameterized_from->inline_environment })
83 : ()),
84 ($self->has_type_parameter
8560326µs ? (%{ $self->type_parameter->inline_environment })
# spent 255µs making 20 calls to Moose::Meta::TypeConstraint::inline_environment, avg 13µs/call # spent 23µs making 10 calls to Moose::Meta::TypeConstraint::Parameterized::has_type_parameter, avg 2µs/call # spent 18µs making 10 calls to Moose::Meta::TypeConstraint::Parameterized::has_parameterized_from, avg 2µs/call # spent 16µs making 10 calls to Moose::Meta::TypeConstraint::Parameterized::parameterized_from, avg 2µs/call # spent 15µs making 10 calls to Moose::Meta::TypeConstraint::Parameterized::type_parameter, avg 2µs/call
86 : ()),
87 };
88}
89
90
# spent 704µs (73+631) within Moose::Meta::TypeConstraint::Parameterized::_inline_check which was called 6 times, avg 117µs/call: # 4 times (46µs+390µs) by Moose::Meta::Attribute::_inline_check_constraint at line 686 of Moose/Meta/Attribute.pm, avg 109µs/call # 2 times (27µs+241µs) by Moose::Meta::TypeConstraint::_actually_compile_type_constraint at line 285 of Moose/Meta/TypeConstraint.pm, avg 134µs/call
sub _inline_check {
911847µs my $self = shift;
92
936153µs return unless $self->can_be_inlined;
# spent 153µs making 6 calls to Moose::Meta::TypeConstraint::Parameterized::can_be_inlined, avg 26µs/call
94
9518478µs return $self->parameterized_from->generate_inline_for( $self->type_parameter, @_ );
# spent 462µs making 6 calls to Moose::Meta::TypeConstraint::Parameterizable::generate_inline_for, avg 77µs/call # spent 8µs making 6 calls to Moose::Meta::TypeConstraint::Parameterized::parameterized_from, avg 1µs/call # spent 8µs making 6 calls to Moose::Meta::TypeConstraint::Parameterized::type_parameter, avg 1µs/call
96}
97
98sub create_child_type {
99 my ($self, %opts) = @_;
100 return Moose::Meta::TypeConstraint::Parameterizable->new(%opts, parent=>$self);
101}
102
10319µs1;
104
105# ABSTRACT: Type constraints with a bound parameter (ArrayRef[Int])
106
107__END__