← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:10 2016

Filename/usr/local/lib/perl/5.18.2/Moose/Meta/Class/Immutable/Trait.pm
StatementsExecuted 8616576 statements in 12.4s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11126µs70µsMoose::Meta::Class::Immutable::Trait::::BEGIN@8Moose::Meta::Class::Immutable::Trait::BEGIN@8
11110µs19µsMoose::Meta::Class::Immutable::Trait::::BEGIN@4Moose::Meta::Class::Immutable::Trait::BEGIN@4
1118µs10µsMoose::Meta::Class::Immutable::Trait::::BEGIN@5Moose::Meta::Class::Immutable::Trait::BEGIN@5
1116µs107µsMoose::Meta::Class::Immutable::Trait::::BEGIN@12Moose::Meta::Class::Immutable::Trait::BEGIN@12
1116µs25µsMoose::Meta::Class::Immutable::Trait::::BEGIN@10Moose::Meta::Class::Immutable::Trait::BEGIN@10
1115µs5µ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;
21400nsour $VERSION = '2.1604';
3
4220µs228µs
# spent 19µs (10+9) within Moose::Meta::Class::Immutable::Trait::BEGIN@4 which was called: # once (10µs+9µs) by Moose::Meta::Class::BEGIN@15 at line 4
use strict;
# spent 19µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@4 # spent 9µs making 1 call to strict::import
5217µs213µs
# spent 10µs (8+3) within Moose::Meta::Class::Immutable::Trait::BEGIN@5 which was called: # once (8µs+3µs) by Moose::Meta::Class::BEGIN@15 at line 5
use warnings;
# spent 10µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@5 # spent 3µs making 1 call to warnings::import
6
7221µs15µs
# spent 5µs within Moose::Meta::Class::Immutable::Trait::BEGIN@7 which was called: # once (5µs+0s) by Moose::Meta::Class::BEGIN@15 at line 7
use Class::MOP;
# spent 5µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@7
8257µs2114µs
# spent 70µs (26+44) within Moose::Meta::Class::Immutable::Trait::BEGIN@8 which was called: # once (26µs+44µs) by Moose::Meta::Class::BEGIN@15 at line 8
use Scalar::Util qw( blessed );
# spent 70µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@8 # spent 44µs making 1 call to Exporter::import
9
10221µs245µs
# spent 25µs (6+20) within Moose::Meta::Class::Immutable::Trait::BEGIN@10 which was called: # once (6µs+20µs) by Moose::Meta::Class::BEGIN@15 at line 10
use parent 'Class::MOP::Class::Immutable::Trait';
# spent 25µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@10 # spent 20µs making 1 call to parent::import
11
122160µs2208µs
# spent 107µs (6+101) within Moose::Meta::Class::Immutable::Trait::BEGIN@12 which was called: # once (6µs+101µs) by Moose::Meta::Class::BEGIN@15 at line 12
use Moose::Util 'throw_exception';
# spent 107µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@12 # spent 101µ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 {
1742µs my $orig = shift;
1842µs my $self = shift;
19429µs4340µs @{ $self->{__immutable}{calculate_all_roles} ||= [ $self->$orig ] };
# spent 340µs making 4 calls to Moose::Meta::Class::calculate_all_roles, avg 85µs/call
20}
21
22sub calculate_all_roles_with_inheritance {
2341µs my $orig = shift;
2441µs my $self = shift;
25453µs41.01ms @{ $self->{__immutable}{calculate_all_roles_with_inheritance} ||= [ $self->$orig ] };
# spent 1.01ms making 4 calls to Moose::Meta::Class::calculate_all_roles_with_inheritance, avg 253µs/call
26}
27
28sub does_role {
291230932158ms shift;
301230932208ms my $self = shift;
311230932343ms my $role = shift;
32
331230932254ms (defined $role)
34 || throw_exception( RoleNameRequired => class_name => $self->name );
35
3612309461.33s181.17ms $self->{__immutable}{does_role} ||= { map { $_->name => 1 } $self->calculate_all_roles_with_inheritance };
# spent 1.16ms making 4 calls to Class::MOP::Class::Immutable::Moose::Meta::Class::calculate_all_roles_with_inheritance, avg 290µs/call # spent 4µs making 11 calls to Class::MOP::Package::name, avg 382ns/call # spent 4µs making 3 calls to Moose::Meta::Role::Composite::name, avg 1µs/call
37
3812309324.75s1230932592ms my $name = blessed $role ? $role->name : $role;
# spent 592ms making 1230932 calls to Scalar::Util::blessed, avg 481ns/call
39
4012309325.35s return $self->{__immutable}{does_role}{$name};
41}
42
4312µs1;
44
45# ABSTRACT: Implements immutability for metaclass objects
46
47__END__