Profile of Moose/Meta/Class/Immutable/Trait.pm

← Index
NYTProf Performance Profile «block view•line view•sub view»
For xt/tapper-mcp-scheduler-with-db-longrun.t
Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:47 2012

Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Moose/Meta/Class/Immutable/Trait.pm
Statements | Executed 19 statements in 308µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 22µs | 27µs | Moose::Meta::Class::Immutable::Trait::::BEGIN@9Moose::Meta::Class::Immutable::Trait::BEGIN@9
1 | 1 | 1 | 9µs | 9µs | Moose::Meta::Class::Immutable::Trait::::BEGIN@2Moose::Meta::Class::Immutable::Trait::BEGIN@2
1 | 1 | 1 | 7µs | 23µs | Moose::Meta::Class::Immutable::Trait::::BEGIN@10Moose::Meta::Class::Immutable::Trait::BEGIN@10
1 | 1 | 1 | 7µs | 46µs | Moose::Meta::Class::Immutable::Trait::::BEGIN@13Moose::Meta::Class::Immutable::Trait::BEGIN@13
1 | 1 | 1 | 7µs | 81µs | Moose::Meta::Class::Immutable::Trait::::BEGIN@15Moose::Meta::Class::Immutable::Trait::BEGIN@15
1 | 1 | 1 | 4µs | 4µs | Moose::Meta::Class::Immutable::Trait::::BEGIN@12Moose::Meta::Class::Immutable::Trait::BEGIN@12
0 | 0 | 0 | 0s | 0s | Moose::Meta::Class::Immutable::Trait::::add_roleMoose::Meta::Class::Immutable::Trait::add_role
0 | 0 | 0 | 0s | 0s | Moose::Meta::Class::Immutable::Trait::::calculate_all_rolesMoose::Meta::Class::Immutable::Trait::calculate_all_roles
0 | 0 | 0 | 0s | 0s | Moose::Meta::Class::Immutable::Trait::::calculate_all_roles_with_inheritanceMoose::Meta::Class::Immutable::Trait::calculate_all_roles_with_inheritance
0 | 0 | 0 | 0s | 0s | Moose::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
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Moose::Meta::Class::Immutable::Trait;
2 |  |  |  |  | # spent 9µs within Moose::Meta::Class::Immutable::Trait::BEGIN@2 which was called: # once (9µs+0s) by Moose::Meta::Class::BEGIN@24 at line 4 BEGIN {
3 | 1 | 4µs |  |  | $Moose::Meta::Class::Immutable::Trait::AUTHORITY = 'cpan:STEVAN';
4 | 1 | 23µs | 1 | 9µs | } # spent 9µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@2
5 |  |  |  |  | {
6 | 2 | 1µs |  |  | $Moose::Meta::Class::Immutable::Trait::VERSION = '2.0602';
7 |  |  |  |  | }
8 |  |  |  |  |
9 | 3 | 18µs | 2 | 31µs | # spent 27µs (22+4) within Moose::Meta::Class::Immutable::Trait::BEGIN@9 which was called: # once (22µs+4µs) by Moose::Meta::Class::BEGIN@24 at line 9 use strict; # spent 27µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@9 # spent 4µs making 1 call to strict::import
10 | 3 | 22µs | 2 | 38µs | # spent 23µs (7+15) within Moose::Meta::Class::Immutable::Trait::BEGIN@10 which was called: # once (7µs+15µs) by Moose::Meta::Class::BEGIN@24 at line 10 use warnings; # spent 23µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@10 # spent 15µs making 1 call to warnings::import
11 |  |  |  |  |
12 | 3 | 20µs | 1 | 4µs | # spent 4µs within Moose::Meta::Class::Immutable::Trait::BEGIN@12 which was called: # once (4µs+0s) by Moose::Meta::Class::BEGIN@24 at line 12 use Class::MOP; # spent 4µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@12
13 | 3 | 20µs | 2 | 85µs | # spent 46µs (7+39) within Moose::Meta::Class::Immutable::Trait::BEGIN@13 which was called: # once (7µs+39µs) by Moose::Meta::Class::BEGIN@24 at line 13 use Scalar::Util qw( blessed ); # spent 46µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@13 # spent 39µs making 1 call to Exporter::import
14 |  |  |  |  |
15 | 3 | 197µs | 2 | 156µs | # spent 81µs (7+75) within Moose::Meta::Class::Immutable::Trait::BEGIN@15 which was called: # once (7µs+75µs) by Moose::Meta::Class::BEGIN@24 at line 15 use base 'Class::MOP::Class::Immutable::Trait'; # spent 81µs making 1 call to Moose::Meta::Class::Immutable::Trait::BEGIN@15 # spent 75µs making 1 call to base::import
16 |  |  |  |  |
17 |  |  |  |  | sub add_role { $_[1]->_immutable_cannot_call }
18 |  |  |  |  |
19 |  |  |  |  | sub calculate_all_roles {
20 |  |  |  |  | my $orig = shift;
21 |  |  |  |  | my $self = shift;
22 |  |  |  |  | @{ $self->{__immutable}{calculate_all_roles} ||= [ $self->$orig ] };
23 |  |  |  |  | }
24 |  |  |  |  |
25 |  |  |  |  | sub calculate_all_roles_with_inheritance {
26 |  |  |  |  | my $orig = shift;
27 |  |  |  |  | my $self = shift;
28 |  |  |  |  | @{ $self->{__immutable}{calculate_all_roles_with_inheritance} ||= [ $self->$orig ] };
29 |  |  |  |  | }
30 |  |  |  |  |
31 |  |  |  |  | sub does_role {
32 |  |  |  |  | shift;
33 |  |  |  |  | my $self = shift;
34 |  |  |  |  | my $role = shift;
35 |  |  |  |  |
36 |  |  |  |  | (defined $role)
37 |  |  |  |  | || $self->throw_error("You must supply a role name to look for");
38 |  |  |  |  |
39 |  |  |  |  | $self->{__immutable}{does_role} ||= { map { $_->name => 1 } $self->calculate_all_roles_with_inheritance };
40 |  |  |  |  |
41 |  |  |  |  | my $name = blessed $role ? $role->name : $role;
42 |  |  |  |  |
43 |  |  |  |  | return $self->{__immutable}{does_role}{$name};
44 |  |  |  |  | }
45 |  |  |  |  |
46 | 1 | 2µs |  |  | 1;
47 |  |  |  |  |
48 |  |  |  |  | # ABSTRACT: Implements immutability for metaclass objects
49 |  |  |  |  |
- - |  |  |  |  |
52 |  |  |  |  | =pod
53 |  |  |  |  |
54 |  |  |  |  | =head1 NAME
55 |  |  |  |  |
56 |  |  |  |  | Moose::Meta::Class::Immutable::Trait - Implements immutability for metaclass objects
57 |  |  |  |  |
58 |  |  |  |  | =head1 VERSION
59 |  |  |  |  |
60 |  |  |  |  | version 2.0602
61 |  |  |  |  |
62 |  |  |  |  | =head1 DESCRIPTION
63 |  |  |  |  |
64 |  |  |  |  | This class makes some Moose-specific metaclass methods immutable. This
65 |  |  |  |  | is deep guts.
66 |  |  |  |  |
67 |  |  |  |  | =head1 BUGS
68 |  |  |  |  |
69 |  |  |  |  | See L<Moose/BUGS> for details on reporting bugs.
70 |  |  |  |  |
71 |  |  |  |  | =head1 AUTHOR
72 |  |  |  |  |
73 |  |  |  |  | Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details.
74 |  |  |  |  |
75 |  |  |  |  | =head1 COPYRIGHT AND LICENSE
76 |  |  |  |  |
77 |  |  |  |  | This software is copyright (c) 2012 by Infinity Interactive, Inc..
78 |  |  |  |  |
79 |  |  |  |  | This is free software; you can redistribute it and/or modify it under
80 |  |  |  |  | the same terms as the Perl 5 programming language system itself.
81 |  |  |  |  |
82 |  |  |  |  | =cut
83 |  |  |  |  |
84 |  |  |  |  |
85 |  |  |  |  | __END__