← 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:46:04 2015

Filename/Users/ap13/perl5/lib/perl5/darwin-2level/Moose/Meta/Role/Attribute.pm
StatementsExecuted 196 statements in 1.26ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1711294µs7.33msMoose::Meta::Role::Attribute::::attribute_for_classMoose::Meta::Role::Attribute::attribute_for_class
1311122µs122µsMoose::Meta::Role::Attribute::::newMoose::Meta::Role::Attribute::new
1711117µs196µsMoose::Meta::Role::Attribute::::original_roleMoose::Meta::Role::Attribute::original_role
131192µs119µsMoose::Meta::Role::Attribute::::attach_to_roleMoose::Meta::Role::Attribute::attach_to_role
11119µs65µsMoose::Meta::Role::Attribute::::BEGIN@7Moose::Meta::Role::Attribute::BEGIN@7
11113µs25µsMoose::Meta::Role::Attribute::::BEGIN@4Moose::Meta::Role::Attribute::BEGIN@4
11110µs57µsMoose::Meta::Role::Attribute::::BEGIN@10Moose::Meta::Role::Attribute::BEGIN@10
1119µs201µsMoose::Meta::Role::Attribute::::BEGIN@12Moose::Meta::Role::Attribute::BEGIN@12
1118µs32µsMoose::Meta::Role::Attribute::::BEGIN@8Moose::Meta::Role::Attribute::BEGIN@8
1118µs12µsMoose::Meta::Role::Attribute::::BEGIN@5Moose::Meta::Role::Attribute::BEGIN@5
0000s0sMoose::Meta::Role::Attribute::::__ANON__[:119]Moose::Meta::Role::Attribute::__ANON__[:119]
0000s0sMoose::Meta::Role::Attribute::::cloneMoose::Meta::Role::Attribute::clone
0000s0sMoose::Meta::Role::Attribute::::is_same_asMoose::Meta::Role::Attribute::is_same_as
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::Role::Attribute;
21600nsour $VERSION = '2.1403';
3
4228µs238µs
# spent 25µs (13+13) within Moose::Meta::Role::Attribute::BEGIN@4 which was called: # once (13µs+13µs) by Moose::Meta::Role::BEGIN@11 at line 4
use strict;
# spent 25µs making 1 call to Moose::Meta::Role::Attribute::BEGIN@4 # spent 13µs making 1 call to strict::import
5228µs217µs
# spent 12µs (8+4) within Moose::Meta::Role::Attribute::BEGIN@5 which was called: # once (8µs+4µs) by Moose::Meta::Role::BEGIN@11 at line 5
use warnings;
# spent 12µs making 1 call to Moose::Meta::Role::Attribute::BEGIN@5 # spent 4µs making 1 call to warnings::import
6
7350µs390µs
# spent 65µs (19+46) within Moose::Meta::Role::Attribute::BEGIN@7 which was called: # once (19µs+46µs) by Moose::Meta::Role::BEGIN@11 at line 7
use List::Util 1.33 'all';
# spent 65µs making 1 call to Moose::Meta::Role::Attribute::BEGIN@7 # spent 14µs making 1 call to UNIVERSAL::VERSION # spent 11µs making 1 call to List::Util::import
8224µs256µs
# spent 32µs (8+24) within Moose::Meta::Role::Attribute::BEGIN@8 which was called: # once (8µs+24µs) by Moose::Meta::Role::BEGIN@11 at line 8
use Scalar::Util 'blessed', 'weaken';
# spent 32µs making 1 call to Moose::Meta::Role::Attribute::BEGIN@8 # spent 24µs making 1 call to Exporter::import
9
10227µs2104µs
# spent 57µs (10+47) within Moose::Meta::Role::Attribute::BEGIN@10 which was called: # once (10µs+47µs) by Moose::Meta::Role::BEGIN@11 at line 10
use parent 'Moose::Meta::Mixin::AttributeCore', 'Class::MOP::Object';
# spent 57µs making 1 call to Moose::Meta::Role::Attribute::BEGIN@10 # spent 47µs making 1 call to parent::import
11
122460µs2394µs
# spent 201µs (9+193) within Moose::Meta::Role::Attribute::BEGIN@12 which was called: # once (9µs+193µs) by Moose::Meta::Role::BEGIN@11 at line 12
use Moose::Util 'throw_exception';
# spent 201µs making 1 call to Moose::Meta::Role::Attribute::BEGIN@12 # spent 192µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
13
14111µs3931µs__PACKAGE__->meta->add_attribute(
# spent 487µs making 1 call to Class::MOP::Mixin::meta # spent 436µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 8µs making 1 call to Class::MOP::_definition_context
15 'metaclass' => (
16 reader => 'metaclass',
17 Class::MOP::_definition_context(),
18 )
19);
20
2114µs3309µs__PACKAGE__->meta->add_attribute(
# spent 293µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 11µs making 1 call to Class::MOP::Mixin::meta # spent 5µs making 1 call to Class::MOP::_definition_context
22 'associated_role' => (
23 reader => 'associated_role',
24 Class::MOP::_definition_context(),
25 )
26);
27
2814µs3304µs__PACKAGE__->meta->add_attribute(
# spent 288µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 10µs making 1 call to Class::MOP::Mixin::meta # spent 5µs making 1 call to Class::MOP::_definition_context
29 '_original_role' => (
30 reader => '_original_role',
31 Class::MOP::_definition_context(),
32 )
33);
34
3514µs3313µs__PACKAGE__->meta->add_attribute(
# spent 298µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 10µs making 1 call to Class::MOP::Mixin::meta # spent 5µs making 1 call to Class::MOP::_definition_context
36 'is' => (
37 reader => 'is',
38 Class::MOP::_definition_context(),
39 )
40);
41
4214µs3298µs__PACKAGE__->meta->add_attribute(
# spent 283µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 10µs making 1 call to Class::MOP::Mixin::meta # spent 5µs making 1 call to Class::MOP::_definition_context
43 'original_options' => (
44 reader => 'original_options',
45 Class::MOP::_definition_context(),
46 )
47);
48
49
# spent 122µs within Moose::Meta::Role::Attribute::new which was called 13 times, avg 9µs/call: # 13 times (122µs+0s) by Class::MOP::Mixin::HasAttributes::add_attribute at line 14 of Class/MOP/Mixin/HasAttributes.pm, avg 9µs/call
sub new {
501324µs my ( $class, $name, %options ) = @_;
51
52132µs (defined $name)
53 || throw_exception( MustProvideANameForTheAttribute => params => \%options,
54 class => $class
55 );
56
57135µs my $role = delete $options{_original_role};
58
591398µs return bless {
60 name => $name,
61 original_options => \%options,
62 _original_role => $role,
63 %options,
64 }, $class;
65}
66
67
# spent 119µs (92+27) within Moose::Meta::Role::Attribute::attach_to_role which was called 13 times, avg 9µs/call: # 13 times (92µs+27µs) by Moose::Meta::Role::_attach_attribute at line 256 of Moose/Meta/Role.pm, avg 9µs/call
sub attach_to_role {
68135µs my ( $self, $role ) = @_;
69
701358µs2617µs ( blessed($role) && $role->isa('Moose::Meta::Role') )
# spent 9µs making 13 calls to Scalar::Util::blessed, avg 708ns/call # spent 8µs making 13 calls to UNIVERSAL::isa, avg 592ns/call
71 || throw_exception( MustPassAMooseMetaRoleInstanceOrSubclass => class => $self,
72 role => $role
73 );
74
751362µs1310µs weaken( $self->{'associated_role'} = $role );
# spent 10µs making 13 calls to Scalar::Util::weaken, avg 754ns/call
76}
77
78
# spent 196µs (117+79) within Moose::Meta::Role::Attribute::original_role which was called 17 times, avg 12µs/call: # 17 times (117µs+79µs) by Moose::Meta::Role::Attribute::attribute_for_class at line 87, avg 12µs/call
sub original_role {
79174µs my $self = shift;
80
811788µs3479µs return $self->_original_role || $self->associated_role;
# spent 42µs making 17 calls to Moose::Meta::Role::Attribute::_original_role, avg 2µs/call # spent 37µs making 17 calls to Moose::Meta::Role::Attribute::associated_role, avg 2µs/call
82}
83
84
# spent 7.33ms (294µs+7.04) within Moose::Meta::Role::Attribute::attribute_for_class which was called 17 times, avg 431µs/call: # 17 times (294µs+7.04ms) by Moose::Meta::Role::Application::ToClass::apply_attributes at line 126 of Moose/Meta/Role/Application/ToClass.pm, avg 431µs/call
sub attribute_for_class {
85176µs my $self = shift;
86
871761µs34242µs my $metaclass = $self->original_role->applied_attribute_metaclass;
# spent 196µs making 17 calls to Moose::Meta::Role::Attribute::original_role, avg 12µs/call # spent 46µs making 17 calls to Moose::Meta::Role::applied_attribute_metaclass, avg 3µs/call
88
89 return $metaclass->interpolate_class_and_new(
9017185µs516.80ms $self->name => %{ $self->original_options } );
# spent 6.75ms making 17 calls to Moose::Meta::Attribute::interpolate_class_and_new, avg 397µs/call # spent 39µs making 17 calls to Moose::Meta::Role::Attribute::original_options, avg 2µs/call # spent 12µs making 17 calls to Class::MOP::Mixin::AttributeCore::name, avg 700ns/call
91}
92
93sub clone {
94 my $self = shift;
95
96 my $role = $self->original_role;
97
98 return ( ref $self )->new(
99 $self->name,
100 %{ $self->original_options },
101 _original_role => $role,
102 );
103}
104
105sub is_same_as {
106 my $self = shift;
107 my $attr = shift;
108
109 my $self_options = $self->original_options;
110 my $other_options = $attr->original_options;
111
112 return 0
113 unless ( join q{|}, sort keys %{$self_options} ) eq ( join q{|}, sort keys %{$other_options} );
114
115 for my $key ( keys %{$self_options} ) {
116 return 0 if defined $self_options->{$key} && ! defined $other_options->{$key};
117 return 0 if ! defined $self_options->{$key} && defined $other_options->{$key};
118
119 next if all { ! defined } $self_options->{$key}, $other_options->{$key};
120
121 return 0 unless $self_options->{$key} eq $other_options->{$key};
122 }
123
124 return 1;
125}
126
127115µs1;
128
129# ABSTRACT: The Moose attribute metaclass for Roles
130
131__END__