← 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:37 2015

Filename/Users/ap13/perl5/lib/perl5/darwin-2level/Moose/Meta/Class/Immutable/Trait.pm
StatementsExecuted 14 statements in 526µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11120µs40µsMoose::Meta::Class::Immutable::Trait::::BEGIN@4Moose::Meta::Class::Immutable::Trait::BEGIN@4
11120µs82µsMoose::Meta::Class::Immutable::Trait::::BEGIN@8Moose::Meta::Class::Immutable::Trait::BEGIN@8
11113µs19µsMoose::Meta::Class::Immutable::Trait::::BEGIN@5Moose::Meta::Class::Immutable::Trait::BEGIN@5
11112µs50µsMoose::Meta::Class::Immutable::Trait::::BEGIN@10Moose::Meta::Class::Immutable::Trait::BEGIN@10
11111µs214µsMoose::Meta::Class::Immutable::Trait::::BEGIN@12Moose::Meta::Class::Immutable::Trait::BEGIN@12
1118µs8µsMoose::Meta::Class::Immutable::Trait::::BEGIN@7Moose::Meta::Class::Immutable::Trait::BEGIN@7
0000s0sMoose::Meta::Class::Immutable::Trait::::add_roleMoose::Meta::Class::Immutable::Trait::add_role
0000s0sMoose::Meta::Class::Immutable::Trait::::calculate_all_rolesMoose::Meta::Class::Immutable::Trait::calculate_all_roles
0000s0sMoose::Meta::Class::Immutable::Trait::::calculate_all_roles_with_inheritanceMoose::Meta::Class::Immutable::Trait::calculate_all_roles_with_inheritance
0000s0sMoose::Meta::Class::Immutable::Trait::::does_roleMoose::Meta::Class::Immutable::Trait::does_role
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::Class::Immutable::Trait;
211µsour $VERSION = '2.1403';
3
4242µs261µs
# spent 40µs (20+20) within Moose::Meta::Class::Immutable::Trait::BEGIN@4 which was called: # once (20µs+20µs) by Moose::Meta::Class::BEGIN@15 at line 4
use strict;
# spent 40µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@4 # spent 20µs making 1 call to strict::import
5238µs226µs
# spent 19µs (13+7) within Moose::Meta::Class::Immutable::Trait::BEGIN@5 which was called: # once (13µs+7µs) by Moose::Meta::Class::BEGIN@15 at line 5
use warnings;
# spent 19µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@5 # spent 7µs making 1 call to warnings::import
6
7242µs18µs
# spent 8µs within Moose::Meta::Class::Immutable::Trait::BEGIN@7 which was called: # once (8µs+0s) by Moose::Meta::Class::BEGIN@15 at line 7
use Class::MOP;
# spent 8µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@7
8248µs2143µs
# spent 82µs (20+62) within Moose::Meta::Class::Immutable::Trait::BEGIN@8 which was called: # once (20µs+62µs) by Moose::Meta::Class::BEGIN@15 at line 8
use Scalar::Util qw( blessed );
# spent 82µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@8 # spent 62µs making 1 call to Exporter::import
9
10240µs288µs
# spent 50µs (12+38) within Moose::Meta::Class::Immutable::Trait::BEGIN@10 which was called: # once (12µs+38µs) by Moose::Meta::Class::BEGIN@15 at line 10
use parent 'Class::MOP::Class::Immutable::Trait';
# spent 50µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@10 # spent 38µs making 1 call to parent::import
11
122311µs2416µs
# spent 214µs (11+202) within Moose::Meta::Class::Immutable::Trait::BEGIN@12 which was called: # once (11µs+202µs) by Moose::Meta::Class::BEGIN@15 at line 12
use Moose::Util 'throw_exception';
# spent 214µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@12 # spent 202µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
13
14sub add_role { $_[1]->_immutable_cannot_call }
15
16sub calculate_all_roles {
17 my $orig = shift;
18 my $self = shift;
19 @{ $self->{__immutable}{calculate_all_roles} ||= [ $self->$orig ] };
20}
21
22sub calculate_all_roles_with_inheritance {
23 my $orig = shift;
24 my $self = shift;
25 @{ $self->{__immutable}{calculate_all_roles_with_inheritance} ||= [ $self->$orig ] };
26}
27
28sub does_role {
29 shift;
30 my $self = shift;
31 my $role = shift;
32
33 (defined $role)
34 || throw_exception( RoleNameRequired => class_name => $self->name );
35
36 $self->{__immutable}{does_role} ||= { map { $_->name => 1 } $self->calculate_all_roles_with_inheritance };
37
38 my $name = blessed $role ? $role->name : $role;
39
40 return $self->{__immutable}{does_role}{$name};
41}
42
4314µs1;
44
45# ABSTRACT: Implements immutability for metaclass objects
46
47__END__