File | /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Class/MOP/Mixin/AttributeCore.pm |
Statements Executed | 3422 |
Statement Execution Time | 6.49ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 1.13ms | 2.04ms | BEGIN@12 | Class::MOP::Mixin::AttributeCore::
479 | 7 | 4 | 575µs | 575µs | init_arg | Class::MOP::Mixin::AttributeCore::
930 | 15 | 6 | 496µs | 496µs | name (xsub) | Class::MOP::Mixin::AttributeCore::
170 | 6 | 4 | 446µs | 15.1ms | default | Class::MOP::Mixin::AttributeCore::
275 | 4 | 2 | 354µs | 354µs | has_default | Class::MOP::Mixin::AttributeCore::
149 | 4 | 4 | 350µs | 350µs | is_default_a_coderef | Class::MOP::Mixin::AttributeCore::
187 | 1 | 1 | 269µs | 269µs | has_writer | Class::MOP::Mixin::AttributeCore::
187 | 1 | 1 | 248µs | 248µs | has_accessor | Class::MOP::Mixin::AttributeCore::
187 | 1 | 1 | 226µs | 226µs | has_reader | Class::MOP::Mixin::AttributeCore::
229 | 1 | 1 | 223µs | 223µs | definition_context | Class::MOP::Mixin::AttributeCore::
187 | 1 | 1 | 220µs | 220µs | has_clearer | Class::MOP::Mixin::AttributeCore::
187 | 1 | 1 | 212µs | 212µs | has_predicate | Class::MOP::Mixin::AttributeCore::
184 | 3 | 2 | 207µs | 207µs | has_builder | Class::MOP::Mixin::AttributeCore::
154 | 1 | 1 | 182µs | 182µs | reader | Class::MOP::Mixin::AttributeCore::
119 | 1 | 1 | 142µs | 142µs | _set_insertion_order | Class::MOP::Mixin::AttributeCore::
60 | 2 | 2 | 73µs | 73µs | has_initializer | Class::MOP::Mixin::AttributeCore::
36 | 1 | 1 | 47µs | 47µs | predicate | Class::MOP::Mixin::AttributeCore::
31 | 1 | 1 | 45µs | 45µs | accessor | Class::MOP::Mixin::AttributeCore::
1 | 1 | 1 | 22µs | 32µs | BEGIN@3 | Class::MOP::Mixin::AttributeCore::
8 | 1 | 1 | 13µs | 13µs | writer | Class::MOP::Mixin::AttributeCore::
1 | 1 | 1 | 12µs | 37µs | BEGIN@4 | Class::MOP::Mixin::AttributeCore::
1 | 1 | 1 | 9µs | 76µs | BEGIN@10 | Class::MOP::Mixin::AttributeCore::
0 | 0 | 0 | 0s | 0s | builder | Class::MOP::Mixin::AttributeCore::
0 | 0 | 0 | 0s | 0s | clearer | Class::MOP::Mixin::AttributeCore::
0 | 0 | 0 | 0s | 0s | has_init_arg | Class::MOP::Mixin::AttributeCore::
0 | 0 | 0 | 0s | 0s | has_insertion_order | 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::
0 | 0 | 0 | 0s | 0s | initializer | Class::MOP::Mixin::AttributeCore::
0 | 0 | 0 | 0s | 0s | insertion_order | Class::MOP::Mixin::AttributeCore::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Class::MOP::Mixin::AttributeCore; | ||||
2 | |||||
3 | 3 | 32µs | 2 | 41µs | # spent 32µs (22+9) within Class::MOP::Mixin::AttributeCore::BEGIN@3 which was called
# once (22µs+9µs) by Class::MOP::BEGIN@15 at line 3 # spent 32µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@3
# spent 9µs making 1 call to strict::import |
4 | 3 | 65µs | 2 | 62µs | # spent 37µs (12+25) within Class::MOP::Mixin::AttributeCore::BEGIN@4 which was called
# once (12µs+25µs) by Class::MOP::BEGIN@15 at line 4 # spent 37µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@4
# spent 25µs making 1 call to warnings::import |
5 | |||||
6 | 1 | 700ns | our $VERSION = '0.98'; | ||
7 | 1 | 19µs | $VERSION = eval $VERSION; | ||
8 | 1 | 400ns | our $AUTHORITY = 'cpan:STEVAN'; | ||
9 | |||||
10 | 3 | 29µs | 2 | 143µs | # spent 76µs (9+67) within Class::MOP::Mixin::AttributeCore::BEGIN@10 which was called
# once (9µs+67µs) by Class::MOP::BEGIN@15 at line 10 # spent 76µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@10
# spent 67µs making 1 call to Exporter::import |
11 | |||||
12 | 3 | 534µs | 2 | 2.87ms | # spent 2.04ms (1.13+914µs) within Class::MOP::Mixin::AttributeCore::BEGIN@12 which was called
# once (1.13ms+914µs) by Class::MOP::BEGIN@15 at line 12 # spent 2.04ms making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@12
# spent 831µs making 1 call to base::import |
13 | |||||
14 | 187 | 386µs | # spent 248µs within Class::MOP::Mixin::AttributeCore::has_accessor which was called 187 times, avg 1µs/call:
# 187 times (248µs+0s) by Class::MOP::Attribute::install_accessors at line 354 of Class/MOP/Attribute.pm, avg 1µs/call | ||
15 | 187 | 343µs | # spent 226µs within Class::MOP::Mixin::AttributeCore::has_reader which was called 187 times, avg 1µs/call:
# 187 times (226µs+0s) by Class::MOP::Attribute::install_accessors at line 358 of Class/MOP/Attribute.pm, avg 1µs/call | ||
16 | 187 | 385µs | # spent 269µs within Class::MOP::Mixin::AttributeCore::has_writer which was called 187 times, avg 1µs/call:
# 187 times (269µs+0s) by Class::MOP::Attribute::install_accessors at line 362 of Class/MOP/Attribute.pm, avg 1µs/call | ||
17 | 187 | 348µs | # spent 212µs within Class::MOP::Mixin::AttributeCore::has_predicate which was called 187 times, avg 1µs/call:
# 187 times (212µs+0s) by Class::MOP::Attribute::install_accessors at line 366 of Class/MOP/Attribute.pm, avg 1µs/call | ||
18 | 187 | 359µs | # spent 220µs within Class::MOP::Mixin::AttributeCore::has_clearer which was called 187 times, avg 1µs/call:
# 187 times (220µs+0s) by Class::MOP::Attribute::install_accessors at line 370 of Class/MOP/Attribute.pm, avg 1µs/call | ||
19 | 184 | 332µs | # spent 207µs within Class::MOP::Mixin::AttributeCore::has_builder which was called 184 times, avg 1µs/call:
# 180 times (202µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 136 of Class/MOP/Method/Constructor.pm, avg 1µs/call
# 2 times (3µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 200 of Moose/Meta/Method/Constructor.pm, avg 2µs/call
# 2 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 205 of Moose/Meta/Method/Constructor.pm, avg 900ns/call | ||
20 | sub has_init_arg { defined $_[0]->{'init_arg'} } | ||||
21 | 275 | 576µs | # spent 354µs within Class::MOP::Mixin::AttributeCore::has_default which was called 275 times, avg 1µs/call:
# 267 times (345µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 136 of Class/MOP/Method/Constructor.pm, avg 1µs/call
# 4 times (4µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 205 of Moose/Meta/Method/Constructor.pm, avg 1µs/call
# 2 times (3µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 200 of Moose/Meta/Method/Constructor.pm, avg 1µs/call
# 2 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 216 of Moose/Meta/Method/Constructor.pm, avg 1µs/call | ||
22 | 60 | 117µs | # spent 73µs within Class::MOP::Mixin::AttributeCore::has_initializer which was called 60 times, avg 1µs/call:
# 54 times (67µs+0s) by Class::MOP::Attribute::_set_initial_slot_value at line 146 of Class/MOP/Attribute.pm, avg 1µs/call
# 6 times (6µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_assignment at line 266 of Moose/Meta/Method/Constructor.pm, avg 1µs/call | ||
23 | sub has_insertion_order { defined $_[0]->{'insertion_order'} } | ||||
24 | |||||
25 | 31 | 63µs | # spent 45µs within Class::MOP::Mixin::AttributeCore::accessor which was called 31 times, avg 1µs/call:
# 31 times (45µs+0s) by Class::MOP::Attribute::install_accessors at line 354 of Class/MOP/Attribute.pm, avg 1µs/call | ||
26 | 154 | 292µs | # spent 182µs within Class::MOP::Mixin::AttributeCore::reader which was called 154 times, avg 1µs/call:
# 154 times (182µs+0s) by Class::MOP::Attribute::install_accessors at line 358 of Class/MOP/Attribute.pm, avg 1µs/call | ||
27 | 8 | 23µs | # spent 13µs within Class::MOP::Mixin::AttributeCore::writer which was called 8 times, avg 2µs/call:
# 8 times (13µs+0s) by Class::MOP::Attribute::install_accessors at line 362 of Class/MOP/Attribute.pm, avg 2µs/call | ||
28 | 36 | 73µs | # spent 47µs within Class::MOP::Mixin::AttributeCore::predicate which was called 36 times, avg 1µs/call:
# 36 times (47µs+0s) by Class::MOP::Attribute::install_accessors at line 366 of Class/MOP/Attribute.pm, avg 1µs/call | ||
29 | sub clearer { $_[0]->{'clearer'} } | ||||
30 | sub builder { $_[0]->{'builder'} } | ||||
31 | 479 | 921µs | # spent 575µs within Class::MOP::Mixin::AttributeCore::init_arg which was called 479 times, avg 1µs/call:
# 267 times (318µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 159 of Class/MOP/Method/Constructor.pm, avg 1µs/call
# 140 times (174µs+0s) by Moose::Meta::Attribute::new at line 58 of Moose/Meta/Attribute.pm, avg 1µs/call
# 60 times (71µs+0s) by Class::MOP::Class::_clone_instance at line 422 of Class/MOP/Class.pm, avg 1µs/call
# 6 times (6µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 200 of Moose/Meta/Method/Constructor.pm, avg 1µs/call
# 2 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 231 of Moose/Meta/Method/Constructor.pm, avg 1µs/call
# 2 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 205 of Moose/Meta/Method/Constructor.pm, avg 900ns/call
# 2 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 207 of Moose/Meta/Method/Constructor.pm, avg 900ns/call | ||
32 | sub initializer { $_[0]->{'initializer'} } | ||||
33 | 229 | 404µs | # spent 223µs within Class::MOP::Mixin::AttributeCore::definition_context which was called 229 times, avg 976ns/call:
# 229 times (223µs+0s) by Class::MOP::Attribute::_process_accessors at line 302 of Class/MOP/Attribute.pm, avg 976ns/call | ||
34 | sub insertion_order { $_[0]->{'insertion_order'} } | ||||
35 | 119 | 216µs | # spent 142µs within Class::MOP::Mixin::AttributeCore::_set_insertion_order which was called 119 times, avg 1µs/call:
# 119 times (142µs+0s) by Class::MOP::Mixin::HasAttributes::add_attribute at line 36 of Class/MOP/Mixin/HasAttributes.pm, avg 1µs/call | ||
36 | |||||
37 | sub has_read_method { $_[0]->has_reader || $_[0]->has_accessor } | ||||
38 | sub has_write_method { $_[0]->has_writer || $_[0]->has_accessor } | ||||
39 | |||||
40 | # spent 350µs within Class::MOP::Mixin::AttributeCore::is_default_a_coderef which was called 149 times, avg 2µs/call:
# 87 times (205µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 143 of Class/MOP/Method/Constructor.pm, avg 2µs/call
# 32 times (60µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53, avg 2µs/call
# 28 times (81µs+0s) by Class::MOP::Attribute::new at line 47 of Class/MOP/Attribute.pm, avg 3µs/call
# 2 times (5µs+0s) by Moose::Meta::Method::Constructor::_generate_default_value at line 344 of Moose/Meta/Method/Constructor.pm, avg 2µs/call | ||||
41 | # Uber hack because it is called from CMOP::Attribute constructor as | ||||
42 | # $class->is_default_a_coderef(\%options) | ||||
43 | 406 | 474µs | my ($value) = ref $_[0] ? $_[0]->{'default'} : $_[1]->{'default'}; | ||
44 | |||||
45 | return unless ref($value); | ||||
46 | |||||
47 | return ref($value) eq 'CODE' | ||||
48 | || ( blessed($value) && $value->isa('Class::MOP::Method') ); | ||||
49 | } | ||||
50 | |||||
51 | # spent 15.1ms (446µs+14.6) within Class::MOP::Mixin::AttributeCore::default which was called 170 times, avg 89µs/call:
# 58 times (101µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 145 of Class/MOP/Method/Constructor.pm, avg 2µs/call
# 51 times (111µs+0s) by Class::MOP::Class::_immutable_metaclass at line 939 of Class/MOP/Class.pm, avg 2µs/call
# 30 times (150µs+91µs) by Class::MOP::Attribute::initialize_instance_slot at line 113 of Class/MOP/Attribute.pm, avg 8µs/call
# 29 times (61µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 149 of Class/MOP/Method/Constructor.pm, avg 2µs/call
# once (11µs+8.99ms) by SimpleDB::Client::new at line 33 of generated method (unknown origin)
# once (11µs+5.57ms) by SimpleDB::Client::new at line 23 of generated method (unknown origin) | ||||
52 | 490 | 493µs | my ( $self, $instance ) = @_; | ||
53 | if ( defined $instance && $self->is_default_a_coderef ) { # spent 8.99ms making 1 call to SimpleDB::Client::__ANON__[../lib/SimpleDB/Client.pm:133]
# spent 5.56ms making 1 call to SimpleDB::Client::__ANON__[../lib/SimpleDB/Client.pm:120]
# spent 60µs making 32 calls to Class::MOP::Mixin::AttributeCore::is_default_a_coderef, avg 2µs/call
# spent 5µs making 2 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:34], avg 3µs/call
# spent 5µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:321], avg 3µs/call
# spent 5µs making 2 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:29], avg 2µs/call
# spent 4µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:286], avg 2µs/call
# spent 4µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:176], avg 2µs/call
# spent 4µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:218], avg 2µs/call
# spent 4µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:260], avg 2µs/call
# spent 4µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:305], avg 2µs/call
# spent 2µs making 1 call to Class::MOP::__ANON__[Class/MOP.pm:494]
# spent 2µs making 1 call to Moose::Meta::TypeConstraint::Registry::__ANON__[Moose/Meta/TypeConstraint/Registry.pm:24] | ||||
54 | # if the default is a CODE ref, then we pass in the instance and | ||||
55 | # default can return a value based on that instance. Somewhat crude, | ||||
56 | # but works. | ||||
57 | return $self->{'default'}->($instance); | ||||
58 | } | ||||
59 | $self->{'default'}; | ||||
60 | } | ||||
61 | |||||
62 | 1 | 4µs | 1; | ||
63 | |||||
64 | __END__ | ||||
65 | |||||
66 | =pod | ||||
67 | |||||
68 | =head1 NAME | ||||
69 | |||||
70 | Class::MOP::Mixin::AttributeCore - Core attributes shared by attribute metaclasses | ||||
71 | |||||
72 | =head1 DESCRIPTION | ||||
73 | |||||
74 | This class implements the core attributes (aka properties) shared by all | ||||
75 | attributes. See the L<Class::MOP::Attribute> documentation for API details. | ||||
76 | |||||
77 | =head1 AUTHORS | ||||
78 | |||||
79 | Dave Rolsky E<lt>autarch@urth.orgE<gt> | ||||
80 | |||||
81 | =head1 COPYRIGHT AND LICENSE | ||||
82 | |||||
83 | Copyright 2006-2010 by Infinity Interactive, Inc. | ||||
84 | |||||
85 | L<http://www.iinteractive.com> | ||||
86 | |||||
87 | This library is free software; you can redistribute it and/or modify | ||||
88 | it under the same terms as Perl itself. | ||||
89 | |||||
90 | =cut | ||||
# spent 496µs within Class::MOP::Mixin::AttributeCore::name which was called 930 times, avg 533ns/call:
# 343 times (169µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 159 of Class/MOP/Method/Constructor.pm, avg 491ns/call
# 295 times (152µs+0s) by Class::MOP::Attribute::slots at line 224 of Class/MOP/Attribute.pm, avg 514ns/call
# 119 times (77µs+0s) by Class::MOP::Mixin::HasAttributes::add_attribute at line 30 of Class/MOP/Mixin/HasAttributes.pm, avg 646ns/call
# 54 times (23µs+0s) by Class::MOP::Attribute::_set_initial_slot_value at line 144 of Class/MOP/Attribute.pm, avg 428ns/call
# 52 times (36µs+0s) by Class::MOP::Method::Accessor::_generate_reader_method_inline at line 154 of Class/MOP/Method/Accessor.pm, avg 687ns/call
# 15 times (9µs+0s) by Class::MOP::Method::Accessor::_generate_accessor_method_inline at line 135 of Class/MOP/Method/Accessor.pm, avg 627ns/call
# 13 times (8µs+0s) by Class::MOP::Method::Accessor::_generate_predicate_method_inline at line 189 of Class/MOP/Method/Accessor.pm, avg 631ns/call
# 12 times (7µs+0s) by Class::MOP::Attribute::set_raw_value at line 264 of Class/MOP/Attribute.pm, avg 575ns/call
# 6 times (4µs+0s) by Class::MOP::Attribute::get_raw_value at line 272 of Class/MOP/Attribute.pm, avg 583ns/call
# 6 times (3µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_assignment at line 272 of Moose/Meta/Method/Constructor.pm, avg 467ns/call
# 4 times (3µs+0s) by Class::MOP::Attribute::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Class/MOP/Attribute.pm:340] at line 325 of Class/MOP/Attribute.pm, avg 675ns/call
# 4 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 196 of Moose/Meta/Method/Constructor.pm, avg 600ns/call
# 3 times (2µs+0s) by Class::MOP::Method::Accessor::_generate_writer_method_inline at line 172 of Class/MOP/Method/Accessor.pm, avg 633ns/call
# 2 times (1µs+0s) by Class::MOP::Attribute::has_value at line 280 of Class/MOP/Attribute.pm, avg 700ns/call
# 2 times (800ns+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 200 of Moose/Meta/Method/Constructor.pm, avg 400ns/call |