← 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/TypeCoercion/Union.pm
StatementsExecuted 14 statements in 301µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11112µs24µsMoose::Meta::TypeCoercion::Union::::BEGIN@4Moose::Meta::TypeCoercion::Union::BEGIN@4
11112µs32µsMoose::Meta::TypeCoercion::Union::::BEGIN@10Moose::Meta::TypeCoercion::Union::BEGIN@10
1119µs31µsMoose::Meta::TypeCoercion::Union::::BEGIN@8Moose::Meta::TypeCoercion::Union::BEGIN@8
1118µs167µsMoose::Meta::TypeCoercion::Union::::BEGIN@12Moose::Meta::TypeCoercion::Union::BEGIN@12
1117µs10µsMoose::Meta::TypeCoercion::Union::::BEGIN@5Moose::Meta::TypeCoercion::Union::BEGIN@5
1116µs413µsMoose::Meta::TypeCoercion::Union::::BEGIN@6Moose::Meta::TypeCoercion::Union::BEGIN@6
0000s0sMoose::Meta::TypeCoercion::Union::::__ANON__[:34]Moose::Meta::TypeCoercion::Union::__ANON__[:34]
0000s0sMoose::Meta::TypeCoercion::Union::::add_type_coercionsMoose::Meta::TypeCoercion::Union::add_type_coercions
0000s0sMoose::Meta::TypeCoercion::Union::::compile_type_coercionMoose::Meta::TypeCoercion::Union::compile_type_coercion
0000s0sMoose::Meta::TypeCoercion::Union::::has_coercion_for_typeMoose::Meta::TypeCoercion::Union::has_coercion_for_type
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::TypeCoercion::Union;
21600nsour $VERSION = '2.1403';
3
4221µs237µs
# spent 24µs (12+12) within Moose::Meta::TypeCoercion::Union::BEGIN@4 which was called: # once (12µs+12µs) by Moose::Meta::TypeConstraint::Union::BEGIN@8 at line 4
use strict;
# spent 24µs making 1 call to Moose::Meta::TypeCoercion::Union::BEGIN@4 # spent 12µs making 1 call to strict::import
5219µs214µs
# spent 10µs (7+4) within Moose::Meta::TypeCoercion::Union::BEGIN@5 which was called: # once (7µs+4µs) by Moose::Meta::TypeConstraint::Union::BEGIN@8 at line 5
use warnings;
# spent 10µs making 1 call to Moose::Meta::TypeCoercion::Union::BEGIN@5 # spent 4µs making 1 call to warnings::import
6226µs2819µs
# spent 413µs (6+407) within Moose::Meta::TypeCoercion::Union::BEGIN@6 which was called: # once (6µs+407µs) by Moose::Meta::TypeConstraint::Union::BEGIN@8 at line 6
use metaclass;
# spent 413µs making 1 call to Moose::Meta::TypeCoercion::Union::BEGIN@6 # spent 407µs making 1 call to metaclass::import
7
8225µs253µs
# spent 31µs (9+22) within Moose::Meta::TypeCoercion::Union::BEGIN@8 which was called: # once (9µs+22µs) by Moose::Meta::TypeConstraint::Union::BEGIN@8 at line 8
use Scalar::Util 'blessed';
# spent 31µs making 1 call to Moose::Meta::TypeCoercion::Union::BEGIN@8 # spent 22µs making 1 call to Exporter::import
9
10225µs252µs
# spent 32µs (12+20) within Moose::Meta::TypeCoercion::Union::BEGIN@10 which was called: # once (12µs+20µs) by Moose::Meta::TypeConstraint::Union::BEGIN@8 at line 10
use parent 'Moose::Meta::TypeCoercion';
# spent 32µs making 1 call to Moose::Meta::TypeCoercion::Union::BEGIN@10 # spent 20µs making 1 call to parent::import
11
122182µs2326µs
# spent 167µs (8+159) within Moose::Meta::TypeCoercion::Union::BEGIN@12 which was called: # once (8µs+159µs) by Moose::Meta::TypeConstraint::Union::BEGIN@8 at line 12
use Moose::Util 'throw_exception';
# spent 167µs making 1 call to Moose::Meta::TypeCoercion::Union::BEGIN@12 # spent 159µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
13
14sub compile_type_coercion {
15 my $self = shift;
16 my $type_constraint = $self->type_constraint;
17
18 (blessed $type_constraint && $type_constraint->isa('Moose::Meta::TypeConstraint::Union'))
19 || throw_exception( NeedsTypeConstraintUnionForTypeCoercionUnion => type_coercion_union_object => $self,
20 type_name => $type_constraint->name
21 );
22
23 $self->_compiled_type_coercion(
24 sub {
25 my $value = shift;
26
27 foreach my $type ( grep { $_->has_coercion }
28 @{ $type_constraint->type_constraints } ) {
29 my $temp = $type->coerce($value);
30 return $temp if $type_constraint->check($temp);
31 }
32
33 return $value;
34 }
35 );
36}
37
38sub has_coercion_for_type { 0 }
39
40sub add_type_coercions {
41 my $self = shift;
42 throw_exception( CannotAddAdditionalTypeCoercionsToUnion => type_coercion_union_object => $self );
43}
44
4513µs1;
46
47# ABSTRACT: The Moose Type Coercion metaclass for Unions
48
49__END__