Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Class/MOP/Mixin/AttributeCore.pm |
Statements | Executed 4479 statements in 8.26ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
474 | 5 | 3 | 1.43ms | 4.79ms | default | Class::MOP::Mixin::AttributeCore::
260 | 4 | 4 | 700µs | 700µs | is_default_a_coderef | Class::MOP::Mixin::AttributeCore::
1 | 1 | 1 | 8µs | 8µs | BEGIN@2 | Class::MOP::Mixin::AttributeCore::
1 | 1 | 1 | 7µs | 26µs | BEGIN@12 | Class::MOP::Mixin::AttributeCore::
1 | 1 | 1 | 7µs | 297µs | BEGIN@14 | Class::MOP::Mixin::AttributeCore::
1 | 1 | 1 | 6µs | 14µs | BEGIN@10 | Class::MOP::Mixin::AttributeCore::
1 | 1 | 1 | 6µs | 8µs | BEGIN@9 | Class::MOP::Mixin::AttributeCore::
0 | 0 | 0 | 0s | 0s | has_read_method | Class::MOP::Mixin::AttributeCore::
0 | 0 | 0 | 0s | 0s | has_write_method | Class::MOP::Mixin::AttributeCore::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Class::MOP::Mixin::AttributeCore; | ||||
2 | # spent 8µs within Class::MOP::Mixin::AttributeCore::BEGIN@2 which was called:
# once (8µs+0s) by Class::MOP::BEGIN@23 at line 4 | ||||
3 | 1 | 4µs | $Class::MOP::Mixin::AttributeCore::AUTHORITY = 'cpan:STEVAN'; | ||
4 | 1 | 32µs | 1 | 8µs | } # spent 8µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@2 |
5 | { | ||||
6 | 2 | 1µs | $Class::MOP::Mixin::AttributeCore::VERSION = '2.0602'; | ||
7 | } | ||||
8 | |||||
9 | 3 | 20µs | 2 | 10µs | # spent 8µs (6+2) within Class::MOP::Mixin::AttributeCore::BEGIN@9 which was called:
# once (6µs+2µs) by Class::MOP::BEGIN@23 at line 9 # spent 8µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@9
# spent 2µs making 1 call to strict::import |
10 | 3 | 17µs | 2 | 21µs | # spent 14µs (6+7) within Class::MOP::Mixin::AttributeCore::BEGIN@10 which was called:
# once (6µs+7µs) by Class::MOP::BEGIN@23 at line 10 # spent 14µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@10
# spent 7µs making 1 call to warnings::import |
11 | |||||
12 | 3 | 21µs | 2 | 45µs | # spent 26µs (7+19) within Class::MOP::Mixin::AttributeCore::BEGIN@12 which was called:
# once (7µs+19µs) by Class::MOP::BEGIN@23 at line 12 # spent 26µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@12
# spent 19µs making 1 call to Exporter::import |
13 | |||||
14 | 3 | 292µs | 2 | 587µs | # spent 297µs (7+290) within Class::MOP::Mixin::AttributeCore::BEGIN@14 which was called:
# once (7µs+290µs) by Class::MOP::BEGIN@23 at line 14 # spent 297µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@14
# spent 290µs making 1 call to base::import |
15 | |||||
16 | 207 | 478µs | sub has_accessor { defined $_[0]->{'accessor'} } | ||
17 | 207 | 458µs | sub has_reader { defined $_[0]->{'reader'} } | ||
18 | 207 | 432µs | sub has_writer { defined $_[0]->{'writer'} } | ||
19 | 207 | 434µs | sub has_predicate { defined $_[0]->{'predicate'} } | ||
20 | 207 | 424µs | sub has_clearer { defined $_[0]->{'clearer'} } | ||
21 | 193 | 366µs | sub has_builder { defined $_[0]->{'builder'} } | ||
22 | sub has_init_arg { defined $_[0]->{'init_arg'} } | ||||
23 | 304 | 634µs | sub has_default { exists $_[0]->{'default'} } | ||
24 | 757 | 1.80ms | sub has_initializer { defined $_[0]->{'initializer'} } | ||
25 | sub has_insertion_order { defined $_[0]->{'insertion_order'} } | ||||
26 | |||||
27 | 133 | 300µs | sub _set_insertion_order { $_[0]->{'insertion_order'} = $_[1] } | ||
28 | |||||
29 | sub has_read_method { $_[0]->has_reader || $_[0]->has_accessor } | ||||
30 | sub has_write_method { $_[0]->has_writer || $_[0]->has_accessor } | ||||
31 | |||||
32 | # spent 700µs within Class::MOP::Mixin::AttributeCore::is_default_a_coderef which was called 260 times, avg 3µs/call:
# 131 times (352µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 45, avg 3µs/call
# 96 times (231µs+0s) by Class::MOP::Class::_inline_default_value at line 667 of Class/MOP/Class.pm, avg 2µs/call
# 32 times (112µs+0s) by Class::MOP::Attribute::new at line 49 of Class/MOP/Attribute.pm, avg 4µs/call
# once (5µs+0s) by Moose::Meta::Attribute::_inline_generate_default at line 929 of Moose/Meta/Attribute.pm | ||||
33 | # Uber hack because it is called from CMOP::Attribute constructor as | ||||
34 | # $class->is_default_a_coderef(\%options) | ||||
35 | 696 | 1.00ms | my ($value) = ref $_[0] ? $_[0]->{'default'} : $_[1]->{'default'}; | ||
36 | |||||
37 | return unless ref($value); | ||||
38 | |||||
39 | return ref($value) eq 'CODE' | ||||
40 | || ( blessed($value) && $value->isa('Class::MOP::Method') ); | ||||
41 | } | ||||
42 | |||||
43 | # spent 4.79ms (1.43+3.35) within Class::MOP::Mixin::AttributeCore::default which was called 474 times, avg 10µs/call:
# 286 times (391µs+0s) by Class::MOP::Class::_eval_environment at line 710 of Class/MOP/Class.pm, avg 1µs/call
# 128 times (861µs+520µs) by Class::MOP::Attribute::initialize_instance_slot at line 117 of Class/MOP/Attribute.pm, avg 11µs/call
# 52 times (133µs+0s) by Class::MOP::Class::_immutable_metaclass at line 1335 of Class/MOP/Class.pm, avg 3µs/call
# 5 times (15µs+0s) by Moose::Meta::Attribute::_eval_environment at line 779 of Moose/Meta/Attribute.pm, avg 3µs/call
# 3 times (32µs+2.83ms) by Moose::Meta::Attribute::initialize_instance_slot at line 520 of Moose/Meta/Attribute.pm, avg 955µs/call | ||||
44 | 1345 | 1.54ms | my ( $self, $instance ) = @_; | ||
45 | 208 | 3.35ms | if ( defined $instance && $self->is_default_a_coderef ) { # spent 2.57ms making 1 call to Tapper::MCP::Scheduler::Algorithm::__ANON__[lib/Tapper/MCP/Scheduler/Algorithm.pm:12]
# spent 352µs making 131 calls to Class::MOP::Mixin::AttributeCore::is_default_a_coderef, avg 3µs/call
# spent 249µs making 1 call to Tapper::MCP::Scheduler::Controller::__ANON__[lib/Tapper/MCP/Scheduler/Controller.pm:14]
# spent 32µs making 9 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:37], avg 4µs/call
# spent 23µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:286], avg 3µs/call
# spent 23µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:132], avg 3µs/call
# spent 21µs making 9 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:43], avg 2µs/call
# spent 20µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:177], avg 2µs/call
# spent 20µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:222], avg 2µs/call
# spent 20µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:249], avg 2µs/call
# spent 16µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:269], avg 2µs/call
# spent 2µs making 1 call to Moose::Meta::TypeConstraint::Registry::__ANON__[Moose/Meta/TypeConstraint/Registry.pm:27]
# spent 2µs making 1 call to Class::MOP::__ANON__[Class/MOP.pm:478]
# spent 2µs making 1 call to Tapper::MCP::Scheduler::Controller::__ANON__[lib/Tapper/MCP/Scheduler/Controller.pm:26] | ||
46 | # if the default is a CODE ref, then we pass in the instance and | ||||
47 | # default can return a value based on that instance. Somewhat crude, | ||||
48 | # but works. | ||||
49 | return $self->{'default'}->($instance); | ||||
50 | } | ||||
51 | $self->{'default'}; | ||||
52 | } | ||||
53 | |||||
54 | 1 | 2µs | 1; | ||
55 | |||||
56 | # ABSTRACT: Core attributes shared by attribute metaclasses | ||||
57 | |||||
- - | |||||
60 | =pod | ||||
61 | |||||
62 | =head1 NAME | ||||
63 | |||||
64 | Class::MOP::Mixin::AttributeCore - Core attributes shared by attribute metaclasses | ||||
65 | |||||
66 | =head1 VERSION | ||||
67 | |||||
68 | version 2.0602 | ||||
69 | |||||
70 | =head1 DESCRIPTION | ||||
71 | |||||
72 | This class implements the core attributes (aka properties) shared by all | ||||
73 | attributes. See the L<Class::MOP::Attribute> documentation for API details. | ||||
74 | |||||
75 | =head1 AUTHOR | ||||
76 | |||||
77 | Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details. | ||||
78 | |||||
79 | =head1 COPYRIGHT AND LICENSE | ||||
80 | |||||
81 | This software is copyright (c) 2012 by Infinity Interactive, Inc.. | ||||
82 | |||||
83 | This is free software; you can redistribute it and/or modify it under | ||||
84 | the same terms as the Perl 5 programming language system itself. | ||||
85 | |||||
86 | =cut | ||||
87 | |||||
88 | |||||
89 | __END__ |