| Filename | /usr/local/lib/perl/5.18.2/Class/MOP.pm |
| Statements | Executed 1240163 statements in 5.94s |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1236142 | 9 | 6 | 2.09s | 2.09s | Class::MOP::get_metaclass_by_name |
| 1 | 1 | 1 | 4.95ms | 14.3ms | Class::MOP::BEGIN@18 |
| 747 | 11 | 8 | 2.38ms | 2.66ms | Class::MOP::class_of |
| 1 | 1 | 1 | 1.76ms | 1.95ms | Class::MOP::BEGIN@19 |
| 1583 | 3 | 2 | 1.38ms | 1.38ms | Class::MOP::get_code_info (xsub) |
| 1 | 1 | 1 | 1.11ms | 1.60ms | Class::MOP::BEGIN@9 |
| 375 | 2 | 1 | 1.11ms | 1.33ms | Class::MOP::metaclass_is_weak |
| 1 | 1 | 1 | 886µs | 3.40ms | Class::MOP::BEGIN@16 |
| 1 | 1 | 1 | 759µs | 3.85ms | Class::MOP::BEGIN@17 |
| 131 | 124 | 23 | 523µs | 523µs | Class::MOP::_definition_context |
| 1 | 1 | 1 | 420µs | 495µs | Class::MOP::BEGIN@15 |
| 1 | 1 | 1 | 394µs | 734µs | Class::MOP::BEGIN@14 |
| 143 | 2 | 2 | 260µs | 260µs | Class::MOP::store_metaclass_by_name |
| 109 | 2 | 2 | 176µs | 176µs | Class::MOP::__ANON__[:499] |
| 82 | 1 | 1 | 145µs | 145µs | Class::MOP::does_metaclass_exist |
| 93 | 3 | 2 | 138µs | 138µs | Class::MOP::__ANON__[:184] |
| 93 | 3 | 2 | 128µs | 128µs | Class::MOP::__ANON__[:290] |
| 93 | 3 | 2 | 126µs | 126µs | Class::MOP::__ANON__[:211] |
| 93 | 3 | 2 | 124µs | 124µs | Class::MOP::__ANON__[:243] |
| 74 | 2 | 2 | 106µs | 106µs | Class::MOP::__ANON__[:139] |
| 93 | 3 | 2 | 101µs | 101µs | Class::MOP::__ANON__[:270] |
| 39 | 1 | 1 | 56µs | 56µs | Class::MOP::__ANON__[:307] |
| 50 | 1 | 1 | 32µs | 32µs | Class::MOP::__ANON__ (xsub) |
| 1 | 1 | 1 | 10µs | 14µs | Class::MOP::BEGIN@12 |
| 1 | 1 | 1 | 8µs | 15µs | Class::MOP::BEGIN@10 |
| 1 | 1 | 1 | 8µs | 16µs | Class::MOP::BEGIN@4 |
| 1 | 1 | 1 | 7µs | 39µs | Class::MOP::BEGIN@11 |
| 1 | 1 | 1 | 7µs | 7µs | Class::MOP::BEGIN@20 |
| 1 | 1 | 1 | 7µs | 7µs | Class::MOP::BEGIN@7 |
| 1 | 1 | 1 | 6µs | 6µs | Class::MOP::BEGIN@22 |
| 1 | 1 | 1 | 6µs | 8µs | Class::MOP::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::__ANON__[:507] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::__ANON__[:617] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::get_all_metaclass_instances |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::get_all_metaclass_names |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::get_all_metaclasses |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::is_class_loaded |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::load_class |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::load_first_existing_class |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::remove_metaclass_by_name |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::weaken_metaclass |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Class::MOP; | ||||
| 2 | 1 | 1µs | our $VERSION = '2.1604'; | ||
| 3 | |||||
| 4 | 2 | 17µs | 2 | 25µs | # spent 16µs (8+9) within Class::MOP::BEGIN@4 which was called:
# once (8µs+9µs) by Moose::Exporter::BEGIN@8 at line 4 # spent 16µs making 1 call to Class::MOP::BEGIN@4
# spent 9µs making 1 call to strict::import |
| 5 | 2 | 17µs | 2 | 11µs | # spent 8µs (6+3) within Class::MOP::BEGIN@5 which was called:
# once (6µs+3µs) by Moose::Exporter::BEGIN@8 at line 5 # spent 8µs making 1 call to Class::MOP::BEGIN@5
# spent 3µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 2 | 38µs | 1 | 7µs | # spent 7µs within Class::MOP::BEGIN@7 which was called:
# once (7µs+0s) by Moose::Exporter::BEGIN@8 at line 7 # spent 7µs making 1 call to Class::MOP::BEGIN@7 |
| 8 | |||||
| 9 | 2 | 81µs | 1 | 1.60ms | # spent 1.60ms (1.11+490µs) within Class::MOP::BEGIN@9 which was called:
# once (1.11ms+490µs) by Moose::Exporter::BEGIN@8 at line 9 # spent 1.60ms making 1 call to Class::MOP::BEGIN@9 |
| 10 | 3 | 32µs | 2 | 22µs | # spent 15µs (8+7) within Class::MOP::BEGIN@10 which was called:
# once (8µs+7µs) by Moose::Exporter::BEGIN@8 at line 10 # spent 15µs making 1 call to Class::MOP::BEGIN@10
# spent 7µs making 1 call to UNIVERSAL::VERSION |
| 11 | 2 | 20µs | 2 | 71µs | # spent 39µs (7+32) within Class::MOP::BEGIN@11 which was called:
# once (7µs+32µs) by Moose::Exporter::BEGIN@8 at line 11 # spent 39µs making 1 call to Class::MOP::BEGIN@11
# spent 32µs making 1 call to Exporter::import |
| 12 | 2 | 21µs | 2 | 18µs | # spent 14µs (10+4) within Class::MOP::BEGIN@12 which was called:
# once (10µs+4µs) by Moose::Exporter::BEGIN@8 at line 12 # spent 14µs making 1 call to Class::MOP::BEGIN@12
# spent 4µs making 1 call to Sub::Install::__ANON__[Sub/Install.pm:270] |
| 13 | |||||
| 14 | 2 | 85µs | 1 | 734µs | # spent 734µs (394+339) within Class::MOP::BEGIN@14 which was called:
# once (394µs+339µs) by Moose::Exporter::BEGIN@8 at line 14 # spent 734µs making 1 call to Class::MOP::BEGIN@14 |
| 15 | 2 | 83µs | 1 | 495µs | # spent 495µs (420+75) within Class::MOP::BEGIN@15 which was called:
# once (420µs+75µs) by Moose::Exporter::BEGIN@8 at line 15 # spent 495µs making 1 call to Class::MOP::BEGIN@15 |
| 16 | 2 | 85µs | 1 | 3.40ms | # spent 3.40ms (886µs+2.52) within Class::MOP::BEGIN@16 which was called:
# once (886µs+2.52ms) by Moose::Exporter::BEGIN@8 at line 16 # spent 3.40ms making 1 call to Class::MOP::BEGIN@16 |
| 17 | 2 | 85µs | 1 | 3.85ms | # spent 3.85ms (759µs+3.09) within Class::MOP::BEGIN@17 which was called:
# once (759µs+3.09ms) by Moose::Exporter::BEGIN@8 at line 17 # spent 3.85ms making 1 call to Class::MOP::BEGIN@17 |
| 18 | 2 | 102µs | 1 | 14.3ms | # spent 14.3ms (4.95+9.39) within Class::MOP::BEGIN@18 which was called:
# once (4.95ms+9.39ms) by Moose::Exporter::BEGIN@8 at line 18 # spent 14.3ms making 1 call to Class::MOP::BEGIN@18 |
| 19 | 2 | 100µs | 1 | 1.95ms | # spent 1.95ms (1.76+182µs) within Class::MOP::BEGIN@19 which was called:
# once (1.76ms+182µs) by Moose::Exporter::BEGIN@8 at line 19 # spent 1.95ms making 1 call to Class::MOP::BEGIN@19 |
| 20 | 2 | 57µs | 1 | 7µs | # spent 7µs within Class::MOP::BEGIN@20 which was called:
# once (7µs+0s) by Moose::Exporter::BEGIN@8 at line 20 # spent 7µs making 1 call to Class::MOP::BEGIN@20 |
| 21 | |||||
| 22 | # spent 6µs within Class::MOP::BEGIN@22 which was called:
# once (6µs+0s) by Moose::Exporter::BEGIN@8 at line 29 | ||||
| 23 | *IS_RUNNING_ON_5_10 = ($] < 5.009_005) | ||||
| 24 | ? sub () { 0 } | ||||
| 25 | 1 | 3µs | : sub () { 1 }; | ||
| 26 | |||||
| 27 | # this is either part of core or set up appropriately by MRO::Compat | ||||
| 28 | 1 | 3µs | *check_package_cache_flag = \&mro::get_pkg_gen; | ||
| 29 | 1 | 1.84ms | 1 | 6µs | } # spent 6µs making 1 call to Class::MOP::BEGIN@22 |
| 30 | |||||
| 31 | 1 | 61µs | 1 | 44µs | XSLoader::load( # spent 44µs making 1 call to XSLoader::load |
| 32 | 'Moose', | ||||
| 33 | $VERSION, | ||||
| 34 | ); | ||||
| 35 | |||||
| 36 | { | ||||
| 37 | # Metaclasses are singletons, so we cache them here. | ||||
| 38 | # there is no need to worry about destruction though | ||||
| 39 | # because they should die only when the program dies. | ||||
| 40 | # After all, do package definitions even get reaped? | ||||
| 41 | # Anonymous classes manage their own destruction. | ||||
| 42 | 2 | 700ns | my %METAS; | ||
| 43 | |||||
| 44 | sub get_all_metaclasses { %METAS } | ||||
| 45 | sub get_all_metaclass_instances { values %METAS } | ||||
| 46 | sub get_all_metaclass_names { keys %METAS } | ||||
| 47 | 1236142 | 5.92s | # spent 2.09s within Class::MOP::get_metaclass_by_name which was called 1236142 times, avg 2µs/call:
# 1235442 times (2.09s+0s) by Class::MOP::Class::initialize at line 41 of Class/MOP/Class.pm, avg 2µs/call
# 360 times (200µs+0s) by Class::MOP::Class::_single_metaclass_is_compatible at line 273 of Class/MOP/Class.pm, avg 556ns/call
# 105 times (62µs+0s) by Class::MOP::Class::_construct_class_instance at line 82 of Class/MOP/Class.pm, avg 593ns/call
# 60 times (42µs+0s) by Class::MOP::Class::_class_metaclass_is_compatible at line 247 of Class/MOP/Class.pm, avg 692ns/call
# 39 times (36µs+0s) by Moose::Meta::Class::initialize at line 64 of Moose/Meta/Class.pm, avg 926ns/call
# 38 times (23µs+0s) by Class::MOP::Package::initialize at line 25 of Class/MOP/Package.pm, avg 608ns/call
# 35 times (56µs+0s) by Moose::Role::init_meta at line 129 of Moose/Role.pm, avg 2µs/call
# 35 times (19µs+0s) by Moose::Meta::Role::initialize at line 176 of Moose/Meta/Role.pm, avg 540ns/call
# 28 times (37µs+0s) by Moose::init_meta at line 166 of Moose.pm, avg 1µs/call | ||
| 48 | 143 | 351µs | # spent 260µs within Class::MOP::store_metaclass_by_name which was called 143 times, avg 2µs/call:
# 105 times (200µs+0s) by Class::MOP::Class::_construct_class_instance at line 107 of Class/MOP/Class.pm, avg 2µs/call
# 38 times (60µs+0s) by Class::MOP::Package::initialize at line 32 of Class/MOP/Package.pm, avg 2µs/call | ||
| 49 | sub weaken_metaclass { weaken($METAS{$_[0]}) } | ||||
| 50 | 375 | 6.17ms | 375 | 222µs | # spent 1.33ms (1.11+222µs) within Class::MOP::metaclass_is_weak which was called 375 times, avg 4µs/call:
# 317 times (919µs+182µs) by Class::MOP::Class::_construct_instance at line 528 of Class/MOP/Class.pm, avg 3µs/call
# 58 times (189µs+40µs) by Class::MOP::Class::_inline_preserve_weak_metaclasses at line 692 of Class/MOP/Class.pm, avg 4µs/call # spent 222µs making 375 calls to Scalar::Util::isweak, avg 593ns/call |
| 51 | 82 | 204µs | # spent 145µs within Class::MOP::does_metaclass_exist which was called 82 times, avg 2µs/call:
# 82 times (145µs+0s) by Class::MOP::Class::_immutable_metaclass at line 1357 of Class/MOP/Class.pm, avg 2µs/call | ||
| 52 | sub remove_metaclass_by_name { delete $METAS{$_[0]}; return } | ||||
| 53 | |||||
| 54 | # This handles instances as well as class names | ||||
| 55 | # spent 2.66ms (2.38+282µs) within Class::MOP::class_of which was called 747 times, avg 4µs/call:
# 226 times (503µs+53µs) by Moose::Meta::Class::excludes_role at line 258 of Moose/Meta/Class.pm, avg 2µs/call
# 141 times (662µs+71µs) by Moose::Exporter::__ANON__[/usr/local/lib/perl/5.18.2/Moose/Exporter.pm:252] at line 252 of Moose/Exporter.pm, avg 5µs/call
# 134 times (416µs+60µs) by Moose::Exporter::__ANON__[/usr/local/lib/perl/5.18.2/Moose/Exporter.pm:39] at line 39 of Moose/Exporter.pm, avg 4µs/call
# 96 times (278µs+31µs) by Moose::Util::find_meta at line 54 of Moose/Util.pm, avg 3µs/call
# 62 times (172µs+25µs) by Class::MOP::Class::_superclasses_updated at line 978 of Class/MOP/Class.pm, avg 3µs/call
# 60 times (243µs+28µs) by Moose::Meta::Class::superclasses at line 558 of Moose/Meta/Class.pm, avg 5µs/call
# 16 times (69µs+8µs) by Moose::Meta::Class::calculate_all_roles_with_inheritance at line 224 of Moose/Meta/Class.pm, avg 5µs/call
# 9 times (24µs+3µs) by Moose::Meta::Attribute::BEGIN@16 at line 717 of Moose/Util/TypeConstraints.pm, avg 3µs/call
# once (6µs+1µs) by Class::MOP::Object::_new at line 23 of Class/MOP/Object.pm
# once (5µs+500ns) by Moose::Meta::TypeCoercion::new at line 35 of Moose/Meta/TypeCoercion.pm
# once (3µs+700ns) by Moose::Meta::Attribute::clone at line 237 of Moose/Meta/Attribute.pm | ||||
| 56 | 747 | 146µs | return unless defined $_[0]; | ||
| 57 | 747 | 1.68ms | 747 | 282µs | my $class = blessed($_[0]) || $_[0]; # spent 282µs making 747 calls to Scalar::Util::blessed, avg 377ns/call |
| 58 | 747 | 1.44ms | return $METAS{$class}; | ||
| 59 | } | ||||
| 60 | |||||
| 61 | # NOTE: | ||||
| 62 | # We only cache metaclasses, meaning instances of | ||||
| 63 | # Class::MOP::Class. We do not cache instance of | ||||
| 64 | # Class::MOP::Package or Class::MOP::Module. Mostly | ||||
| 65 | # because I don't yet see a good reason to do so. | ||||
| 66 | } | ||||
| 67 | |||||
| 68 | sub load_class { | ||||
| 69 | Class::MOP::Deprecated::deprecated( | ||||
| 70 | message => 'Class::MOP::load_class is deprecated', | ||||
| 71 | feature => 'Class::Load wrapper functions', | ||||
| 72 | ); | ||||
| 73 | require Class::Load; | ||||
| 74 | goto &Class::Load::load_class; | ||||
| 75 | } | ||||
| 76 | |||||
| 77 | sub load_first_existing_class { | ||||
| 78 | Class::MOP::Deprecated::deprecated( | ||||
| 79 | message => 'Class::MOP::load_first_existing_class is deprecated', | ||||
| 80 | feature => 'Class::Load wrapper functions', | ||||
| 81 | ); | ||||
| 82 | require Class::Load; | ||||
| 83 | goto &Class::Load::load_first_existing_class; | ||||
| 84 | } | ||||
| 85 | |||||
| 86 | sub is_class_loaded { | ||||
| 87 | Class::MOP::Deprecated::deprecated( | ||||
| 88 | message => 'Class::MOP::is_class_loaded is deprecated', | ||||
| 89 | feature => 'Class::Load wrapper functions', | ||||
| 90 | ); | ||||
| 91 | require Class::Load; | ||||
| 92 | goto &Class::Load::is_class_loaded; | ||||
| 93 | } | ||||
| 94 | |||||
| 95 | # spent 523µs within Class::MOP::_definition_context which was called 131 times, avg 4µs/call:
# 5 times (16µs+0s) by Moose::Exporter::BEGIN@8 at line 646, avg 3µs/call
# 3 times (10µs+0s) by Moose::BEGIN@32 at line 306 of Moose/Meta/Role.pm, avg 4µs/call
# 2 times (12µs+0s) by Moose::BEGIN@32 at line 85 of Moose/Meta/Role.pm, avg 6µs/call
# once (8µs+0s) by Moose::Meta::TypeCoercion::BEGIN@8 at line 25 of Moose/Meta/Attribute.pm
# once (8µs+0s) by Moose::BEGIN@24 at line 29 of Moose/Meta/Class.pm
# once (7µs+0s) by Moose::Util::TypeConstraints::BEGIN@25 at line 17 of Moose/Meta/TypeConstraint/Union.pm
# once (7µs+0s) by Moose::BEGIN@36 at line 14 of Moose/Meta/Role/Application/ToClass.pm
# once (7µs+0s) by parent::import at line 9 of Moose/Meta/Mixin/AttributeCore.pm
# once (6µs+0s) by Moose::Util::TypeConstraints::BEGIN@34 at line 14 of Moose/Meta/TypeConstraint/Registry.pm
# once (6µs+0s) by Moose::Meta::Role::BEGIN@11 at line 14 of Moose/Meta/Role/Attribute.pm
# once (6µs+0s) by Moose::Util::TypeConstraints::BEGIN@30 at line 15 of Moose/Meta/TypeConstraint/Enum.pm
# once (6µs+0s) by Moose::Exporter::BEGIN@8 at line 140
# once (6µs+0s) by Moose::Util::TypeConstraints::BEGIN@31 at line 17 of Moose/Meta/TypeConstraint/DuckType.pm
# once (6µs+0s) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@10 at line 16 of Moose/Meta/TypeConstraint/Parameterizable.pm
# once (6µs+0s) by Moose::BEGIN@35 at line 20 of Moose/Meta/Role/Application/RoleSummation.pm
# once (6µs+0s) by Moose::BEGIN@25 at line 22 of Moose/Meta/TypeConstraint.pm
# once (6µs+0s) by Moose::BEGIN@33 at line 18 of Moose/Meta/Role/Composite.pm
# once (5µs+0s) by Moose::BEGIN@34 at line 17 of Moose/Meta/Role/Application.pm
# once (5µs+0s) by Moose::BEGIN@26 at line 16 of Moose/Meta/TypeCoercion.pm
# once (5µs+0s) by Moose::BEGIN@26 at line 28 of Moose/Meta/TypeCoercion.pm
# once (5µs+0s) by Moose::Exporter::BEGIN@8 at line 312
# once (5µs+0s) by parent::import at line 30 of Moose/Meta/Mixin/AttributeCore.pm
# once (5µs+0s) by Moose::BEGIN@24 at line 52 of Moose/Meta/Class.pm
# once (5µs+0s) by Moose::BEGIN@24 at line 46 of Moose/Meta/Class.pm
# once (5µs+0s) by Moose::BEGIN@38 at line 17 of Moose/Meta/Role/Application/ToInstance.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@26 at line 15 of Moose/Meta/TypeConstraint/Parameterized.pm
# once (5µs+0s) by Moose::Exporter::BEGIN@8 at line 555
# once (4µs+0s) by Moose::Util::TypeConstraints::BEGIN@28 at line 14 of Moose/Meta/TypeConstraint/Class.pm
# once (4µs+0s) by Moose::Meta::Role::BEGIN@13 at line 18 of Moose/Meta/Role/Method/Required.pm
# once (4µs+0s) by Moose::Util::TypeConstraints::BEGIN@29 at line 14 of Moose/Meta/TypeConstraint/Role.pm
# once (4µs+0s) by Moose::BEGIN@25 at line 90 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::Util::TypeConstraints::BEGIN@34 at line 24 of Moose/Meta/TypeConstraint/Registry.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 144
# once (4µs+0s) by Moose::Util::TypeConstraints::BEGIN@30 at line 20 of Moose/Meta/TypeConstraint/Enum.pm
# once (4µs+0s) by Moose::BEGIN@34 at line 24 of Moose/Meta/Role/Application.pm
# once (4µs+0s) by Moose::BEGIN@24 at line 35 of Moose/Meta/Class.pm
# once (4µs+0s) by Moose::BEGIN@33 at line 31 of Moose/Meta/Role/Composite.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 212
# once (4µs+0s) by Moose::BEGIN@25 at line 26 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@25 at line 37 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@25 at line 100 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@10 at line 22 of Moose/Meta/TypeConstraint/Parameterizable.pm
# once (4µs+0s) by Moose::BEGIN@33 at line 37 of Moose/Meta/Role/Composite.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 185
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 219
# once (4µs+0s) by Moose::BEGIN@32 at line 134 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@36 at line 19 of Moose/Meta/Role/Application/ToClass.pm
# once (4µs+0s) by Moose::BEGIN@26 at line 19 of Moose/Meta/TypeCoercion.pm
# once (4µs+0s) by Moose::Meta::Role::BEGIN@14 at line 11 of Moose/Meta/Role/Method/Conflicting.pm
# once (4µs+0s) by Moose::Meta::Role::BEGIN@11 at line 21 of Moose/Meta/Role/Attribute.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 583
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 271
# once (4µs+0s) by Moose::BEGIN@32 at line 121 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@32 at line 127 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@32 at line 155 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@32 at line 352 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@25 at line 40 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@25 at line 106 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::Meta::Role::BEGIN@11 at line 35 of Moose/Meta/Role/Attribute.pm
# once (4µs+0s) by Moose::Util::TypeConstraints::BEGIN@26 at line 21 of Moose/Meta/TypeConstraint/Parameterized.pm
# once (4µs+0s) by Moose::BEGIN@33 at line 40 of Moose/Meta/Role/Composite.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 454
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 244
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 328
# once (4µs+0s) by Moose::BEGIN@32 at line 399 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@32 at line 141 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@32 at line 148 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@32 at line 162 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@25 at line 46 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@24 at line 38 of Moose/Meta/Class.pm
# once (4µs+0s) by Moose::Meta::Role::BEGIN@11 at line 28 of Moose/Meta/Role/Attribute.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 618
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 564
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 338
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 635
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 500
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 622
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 391
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 157
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 593
# once (4µs+0s) by Moose::BEGIN@25 at line 73 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@25 at line 79 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::Meta::Role::BEGIN@11 at line 42 of Moose/Meta/Role/Attribute.pm
# once (4µs+0s) by Moose::BEGIN@33 at line 45 of Moose/Meta/Role/Composite.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 308
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 399
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 481
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 511
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 189
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 572
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 430
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 291
# once (4µs+0s) by Moose::Exporter::BEGIN@8 at line 532
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 359
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 438
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 703
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 348
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 422
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 470
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 376
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 446
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 525
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 539
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 518
# once (3µs+0s) by parent::import at line 16 of Moose/Meta/Mixin/AttributeCore.pm
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 602
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 462
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 679
# once (3µs+0s) by parent::import at line 37 of Moose/Meta/Mixin/AttributeCore.pm
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 710
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 696
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 686
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 661
# once (3µs+0s) by parent::import at line 23 of Moose/Meta/Mixin/AttributeCore.pm
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 415
# once (3µs+0s) by Moose::Exporter::BEGIN@8 at line 407
# once (3µs+0s) by parent::import at line 87 of Moose/Meta/Mixin/AttributeCore.pm
# once (3µs+0s) by parent::import at line 43 of Moose/Meta/Mixin/AttributeCore.pm
# once (3µs+0s) by parent::import at line 57 of Moose/Meta/Mixin/AttributeCore.pm
# once (3µs+0s) by parent::import at line 79 of Moose/Meta/Mixin/AttributeCore.pm
# once (3µs+0s) by parent::import at line 50 of Moose/Meta/Mixin/AttributeCore.pm
# once (3µs+0s) by parent::import at line 64 of Moose/Meta/Mixin/AttributeCore.pm
# once (3µs+0s) by parent::import at line 71 of Moose/Meta/Mixin/AttributeCore.pm
# once (3µs+0s) by parent::import at line 96 of Moose/Meta/Mixin/AttributeCore.pm | ||||
| 96 | 131 | 14µs | my %context; | ||
| 97 | 131 | 371µs | @context{qw(package file line)} = caller(1); | ||
| 98 | |||||
| 99 | return ( | ||||
| 100 | 131 | 353µs | definition_context => \%context, | ||
| 101 | ); | ||||
| 102 | } | ||||
| 103 | |||||
| 104 | ## ---------------------------------------------------------------------------- | ||||
| 105 | ## Setting up our environment ... | ||||
| 106 | ## ---------------------------------------------------------------------------- | ||||
| 107 | ## Class::MOP needs to have a few things in the global perl environment so | ||||
| 108 | ## that it can operate effectively. Those things are done here. | ||||
| 109 | ## ---------------------------------------------------------------------------- | ||||
| 110 | |||||
| 111 | # ... nothing yet actually ;) | ||||
| 112 | |||||
| 113 | ## ---------------------------------------------------------------------------- | ||||
| 114 | ## Bootstrapping | ||||
| 115 | ## ---------------------------------------------------------------------------- | ||||
| 116 | ## The code below here is to bootstrap our MOP with itself. This is also | ||||
| 117 | ## sometimes called "tying the knot". By doing this, we make it much easier | ||||
| 118 | ## to extend the MOP through subclassing and such since now you can use the | ||||
| 119 | ## MOP itself to extend itself. | ||||
| 120 | ## | ||||
| 121 | ## Yes, I know, that's weird and insane, but it's a good thing, trust me :) | ||||
| 122 | ## ---------------------------------------------------------------------------- | ||||
| 123 | |||||
| 124 | # We need to add in the meta-attributes here so that | ||||
| 125 | # any subclass of Class::MOP::* will be able to | ||||
| 126 | # inherit them using _construct_instance | ||||
| 127 | |||||
| 128 | ## -------------------------------------------------------- | ||||
| 129 | ## Class::MOP::Mixin::HasMethods | ||||
| 130 | |||||
| 131 | Class::MOP::Mixin::HasMethods->meta->add_attribute( | ||||
| 132 | Class::MOP::Attribute->new('_methods' => ( | ||||
| 133 | reader => { | ||||
| 134 | # NOTE: | ||||
| 135 | # we just alias the original method | ||||
| 136 | # rather than re-produce it here | ||||
| 137 | '_method_map' => \&Class::MOP::Mixin::HasMethods::_method_map | ||||
| 138 | }, | ||||
| 139 | 74 | 173µs | # spent 106µs within Class::MOP::__ANON__[/usr/local/lib/perl/5.18.2/Class/MOP.pm:139] which was called 74 times, avg 1µs/call:
# 39 times (51µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 40 of Class/MOP/Mixin/AttributeCore.pm, avg 1µs/call
# 35 times (55µs+0s) by Moose::Meta::Role::_new at line 15 of (eval 45)[Eval/Closure.pm:144], avg 2µs/call | ||
| 140 | 1 | 14µs | 4 | 1.01ms | _definition_context(), # spent 518µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 455µs making 1 call to Class::MOP::Mixin::meta
# spent 35µs making 1 call to Class::MOP::Attribute::new
# spent 6µs making 1 call to Class::MOP::_definition_context |
| 141 | )) | ||||
| 142 | ); | ||||
| 143 | |||||
| 144 | 1 | 9µs | 4 | 227µs | Class::MOP::Mixin::HasMethods->meta->add_attribute( # spent 199µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 145 | Class::MOP::Attribute->new('method_metaclass' => ( | ||||
| 146 | reader => { | ||||
| 147 | # NOTE: | ||||
| 148 | # we just alias the original method | ||||
| 149 | # rather than re-produce it here | ||||
| 150 | 'method_metaclass' => \&Class::MOP::Mixin::HasMethods::method_metaclass | ||||
| 151 | }, | ||||
| 152 | default => 'Class::MOP::Method', | ||||
| 153 | _definition_context(), | ||||
| 154 | )) | ||||
| 155 | ); | ||||
| 156 | |||||
| 157 | 1 | 7µs | 4 | 212µs | Class::MOP::Mixin::HasMethods->meta->add_attribute( # spent 186µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 158 | Class::MOP::Attribute->new('wrapped_method_metaclass' => ( | ||||
| 159 | reader => { | ||||
| 160 | # NOTE: | ||||
| 161 | # we just alias the original method | ||||
| 162 | # rather than re-produce it here | ||||
| 163 | 'wrapped_method_metaclass' => \&Class::MOP::Mixin::HasMethods::wrapped_method_metaclass | ||||
| 164 | }, | ||||
| 165 | default => 'Class::MOP::Method::Wrapped', | ||||
| 166 | _definition_context(), | ||||
| 167 | )) | ||||
| 168 | ); | ||||
| 169 | |||||
| 170 | ## -------------------------------------------------------- | ||||
| 171 | ## Class::MOP::Mixin::HasAttributes | ||||
| 172 | |||||
| 173 | Class::MOP::Mixin::HasAttributes->meta->add_attribute( | ||||
| 174 | Class::MOP::Attribute->new('attributes' => ( | ||||
| 175 | reader => { | ||||
| 176 | # NOTE: we need to do this in order | ||||
| 177 | # for the instance meta-object to | ||||
| 178 | # not fall into meta-circular death | ||||
| 179 | # | ||||
| 180 | # we just alias the original method | ||||
| 181 | # rather than re-produce it here | ||||
| 182 | '_attribute_map' => \&Class::MOP::Mixin::HasAttributes::_attribute_map | ||||
| 183 | }, | ||||
| 184 | 93 | 207µs | # spent 138µs within Class::MOP::__ANON__[/usr/local/lib/perl/5.18.2/Class/MOP.pm:184] which was called 93 times, avg 1µs/call:
# 39 times (69µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 40 of Class/MOP/Mixin/AttributeCore.pm, avg 2µs/call
# 35 times (47µs+0s) by Moose::Meta::Role::_new at line 69 of (eval 45)[Eval/Closure.pm:144], avg 1µs/call
# 19 times (22µs+0s) by Moose::Meta::Role::Composite::_new at line 84 of (eval 45)[Eval/Closure.pm:144], avg 1µs/call | ||
| 185 | 1 | 14µs | 4 | 424µs | _definition_context(), # spent 209µs making 1 call to Class::MOP::Mixin::meta
# spent 194µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 17µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 186 | )) | ||||
| 187 | ); | ||||
| 188 | |||||
| 189 | 1 | 7µs | 4 | 224µs | Class::MOP::Mixin::HasAttributes->meta->add_attribute( # spent 200µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 190 | Class::MOP::Attribute->new('attribute_metaclass' => ( | ||||
| 191 | reader => { | ||||
| 192 | # NOTE: | ||||
| 193 | # we just alias the original method | ||||
| 194 | # rather than re-produce it here | ||||
| 195 | 'attribute_metaclass' => \&Class::MOP::Mixin::HasAttributes::attribute_metaclass | ||||
| 196 | }, | ||||
| 197 | default => 'Class::MOP::Attribute', | ||||
| 198 | _definition_context(), | ||||
| 199 | )) | ||||
| 200 | ); | ||||
| 201 | |||||
| 202 | ## -------------------------------------------------------- | ||||
| 203 | ## Class::MOP::Mixin::HasOverloads | ||||
| 204 | |||||
| 205 | Class::MOP::Mixin::HasOverloads->meta->add_attribute( | ||||
| 206 | Class::MOP::Attribute->new('_overload_map' => ( | ||||
| 207 | reader => { | ||||
| 208 | '_overload_map' => \&Class::MOP::Mixin::HasOverloads::_overload_map | ||||
| 209 | }, | ||||
| 210 | clearer => '_clear_overload_map', | ||||
| 211 | 93 | 197µs | # spent 126µs within Class::MOP::__ANON__[/usr/local/lib/perl/5.18.2/Class/MOP.pm:211] which was called 93 times, avg 1µs/call:
# 39 times (53µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 40 of Class/MOP/Mixin/AttributeCore.pm, avg 1µs/call
# 35 times (45µs+0s) by Moose::Meta::Role::_new at line 21 of (eval 45)[Eval/Closure.pm:144], avg 1µs/call
# 19 times (29µs+0s) by Moose::Meta::Role::Composite::_new at line 24 of (eval 45)[Eval/Closure.pm:144], avg 2µs/call | ||
| 212 | 1 | 12µs | 4 | 674µs | _definition_context(), # spent 403µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 249µs making 1 call to Class::MOP::Mixin::meta
# spent 18µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 213 | )) | ||||
| 214 | ); | ||||
| 215 | |||||
| 216 | ## -------------------------------------------------------- | ||||
| 217 | ## Class::MOP::Package | ||||
| 218 | |||||
| 219 | 1 | 11µs | 4 | 612µs | Class::MOP::Package->meta->add_attribute( # spent 384µs making 1 call to Class::MOP::Mixin::meta
# spent 207µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 16µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 220 | Class::MOP::Attribute->new('package' => ( | ||||
| 221 | reader => { | ||||
| 222 | # NOTE: we need to do this in order | ||||
| 223 | # for the instance meta-object to | ||||
| 224 | # not fall into meta-circular death | ||||
| 225 | # | ||||
| 226 | # we just alias the original method | ||||
| 227 | # rather than re-produce it here | ||||
| 228 | 'name' => \&Class::MOP::Package::name | ||||
| 229 | }, | ||||
| 230 | _definition_context(), | ||||
| 231 | )) | ||||
| 232 | ); | ||||
| 233 | |||||
| 234 | Class::MOP::Package->meta->add_attribute( | ||||
| 235 | Class::MOP::Attribute->new('namespace' => ( | ||||
| 236 | reader => { | ||||
| 237 | # NOTE: | ||||
| 238 | # we just alias the original method | ||||
| 239 | # rather than re-produce it here | ||||
| 240 | 'namespace' => \&Class::MOP::Package::namespace | ||||
| 241 | }, | ||||
| 242 | init_arg => undef, | ||||
| 243 | 93 | 218µs | # spent 124µs within Class::MOP::__ANON__[/usr/local/lib/perl/5.18.2/Class/MOP.pm:243] which was called 93 times, avg 1µs/call:
# 39 times (57µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 40 of Class/MOP/Mixin/AttributeCore.pm, avg 1µs/call
# 35 times (44µs+0s) by Moose::Meta::Role::_new at line 99 of (eval 45)[Eval/Closure.pm:144], avg 1µs/call
# 19 times (23µs+0s) by Moose::Meta::Role::Composite::_new at line 117 of (eval 45)[Eval/Closure.pm:144], avg 1µs/call | ||
| 244 | 1 | 9µs | 4 | 218µs | _definition_context(), # spent 189µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 16µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 245 | )) | ||||
| 246 | ); | ||||
| 247 | |||||
| 248 | ## -------------------------------------------------------- | ||||
| 249 | ## Class::MOP::Module | ||||
| 250 | |||||
| 251 | # NOTE: | ||||
| 252 | # yeah this is kind of stretching things a bit, | ||||
| 253 | # but truthfully the version should be an attribute | ||||
| 254 | # of the Module, the weirdness comes from having to | ||||
| 255 | # stick to Perl 5 convention and store it in the | ||||
| 256 | # $VERSION package variable. Basically if you just | ||||
| 257 | # squint at it, it will look how you want it to look. | ||||
| 258 | # Either as a package variable, or as a attribute of | ||||
| 259 | # the metaclass, isn't abstraction great :) | ||||
| 260 | |||||
| 261 | Class::MOP::Module->meta->add_attribute( | ||||
| 262 | Class::MOP::Attribute->new('version' => ( | ||||
| 263 | reader => { | ||||
| 264 | # NOTE: | ||||
| 265 | # we just alias the original method | ||||
| 266 | # rather than re-produce it here | ||||
| 267 | 'version' => \&Class::MOP::Module::version | ||||
| 268 | }, | ||||
| 269 | init_arg => undef, | ||||
| 270 | 93 | 177µs | # spent 101µs within Class::MOP::__ANON__[/usr/local/lib/perl/5.18.2/Class/MOP.pm:270] which was called 93 times, avg 1µs/call:
# 39 times (45µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 40 of Class/MOP/Mixin/AttributeCore.pm, avg 1µs/call
# 35 times (39µs+0s) by Moose::Meta::Role::_new at line 129 of (eval 45)[Eval/Closure.pm:144], avg 1µs/call
# 19 times (17µs+0s) by Moose::Meta::Role::Composite::_new at line 147 of (eval 45)[Eval/Closure.pm:144], avg 911ns/call | ||
| 271 | 1 | 12µs | 4 | 417µs | _definition_context(), # spent 200µs making 1 call to Class::MOP::Mixin::meta
# spent 194µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 18µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 272 | )) | ||||
| 273 | ); | ||||
| 274 | |||||
| 275 | # NOTE: | ||||
| 276 | # By following the same conventions as version here, | ||||
| 277 | # we are opening up the possibility that people can | ||||
| 278 | # use the $AUTHORITY in non-Class::MOP modules as | ||||
| 279 | # well. | ||||
| 280 | |||||
| 281 | Class::MOP::Module->meta->add_attribute( | ||||
| 282 | Class::MOP::Attribute->new('authority' => ( | ||||
| 283 | reader => { | ||||
| 284 | # NOTE: | ||||
| 285 | # we just alias the original method | ||||
| 286 | # rather than re-produce it here | ||||
| 287 | 'authority' => \&Class::MOP::Module::authority | ||||
| 288 | }, | ||||
| 289 | init_arg => undef, | ||||
| 290 | 93 | 174µs | # spent 128µs within Class::MOP::__ANON__[/usr/local/lib/perl/5.18.2/Class/MOP.pm:290] which was called 93 times, avg 1µs/call:
# 39 times (54µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 40 of Class/MOP/Mixin/AttributeCore.pm, avg 1µs/call
# 35 times (52µs+0s) by Moose::Meta::Role::_new at line 72 of (eval 45)[Eval/Closure.pm:144], avg 1µs/call
# 19 times (22µs+0s) by Moose::Meta::Role::Composite::_new at line 87 of (eval 45)[Eval/Closure.pm:144], avg 1µs/call | ||
| 291 | 1 | 9µs | 4 | 214µs | _definition_context(), # spent 184µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 19µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 292 | )) | ||||
| 293 | ); | ||||
| 294 | |||||
| 295 | ## -------------------------------------------------------- | ||||
| 296 | ## Class::MOP::Class | ||||
| 297 | |||||
| 298 | Class::MOP::Class->meta->add_attribute( | ||||
| 299 | Class::MOP::Attribute->new('superclasses' => ( | ||||
| 300 | accessor => { | ||||
| 301 | # NOTE: | ||||
| 302 | # we just alias the original method | ||||
| 303 | # rather than re-produce it here | ||||
| 304 | 'superclasses' => \&Class::MOP::Class::superclasses | ||||
| 305 | }, | ||||
| 306 | init_arg => undef, | ||||
| 307 | 39 | 76µs | # spent 56µs within Class::MOP::__ANON__[/usr/local/lib/perl/5.18.2/Class/MOP.pm:307] which was called 39 times, avg 1µs/call:
# 39 times (56µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 40 of Class/MOP/Mixin/AttributeCore.pm, avg 1µs/call | ||
| 308 | 1 | 12µs | 4 | 5.90ms | _definition_context(), # spent 5.37ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 508µs making 1 call to Class::MOP::Mixin::meta
# spent 16µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 309 | )) | ||||
| 310 | ); | ||||
| 311 | |||||
| 312 | 1 | 7µs | 4 | 218µs | Class::MOP::Class->meta->add_attribute( # spent 183µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 19µs making 1 call to Class::MOP::Attribute::new
# spent 12µs making 1 call to Class::MOP::Mixin::meta
# spent 5µs making 1 call to Class::MOP::_definition_context |
| 313 | Class::MOP::Attribute->new('instance_metaclass' => ( | ||||
| 314 | reader => { | ||||
| 315 | # NOTE: we need to do this in order | ||||
| 316 | # for the instance meta-object to | ||||
| 317 | # not fall into meta-circular death | ||||
| 318 | # | ||||
| 319 | # we just alias the original method | ||||
| 320 | # rather than re-produce it here | ||||
| 321 | 'instance_metaclass' => \&Class::MOP::Class::instance_metaclass | ||||
| 322 | }, | ||||
| 323 | default => 'Class::MOP::Instance', | ||||
| 324 | _definition_context(), | ||||
| 325 | )) | ||||
| 326 | ); | ||||
| 327 | |||||
| 328 | 1 | 7µs | 4 | 204µs | Class::MOP::Class->meta->add_attribute( # spent 180µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 329 | Class::MOP::Attribute->new('immutable_trait' => ( | ||||
| 330 | reader => { | ||||
| 331 | 'immutable_trait' => \&Class::MOP::Class::immutable_trait | ||||
| 332 | }, | ||||
| 333 | default => "Class::MOP::Class::Immutable::Trait", | ||||
| 334 | _definition_context(), | ||||
| 335 | )) | ||||
| 336 | ); | ||||
| 337 | |||||
| 338 | 1 | 5µs | 4 | 193µs | Class::MOP::Class->meta->add_attribute( # spent 168µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 339 | Class::MOP::Attribute->new('constructor_name' => ( | ||||
| 340 | reader => { | ||||
| 341 | 'constructor_name' => \&Class::MOP::Class::constructor_name, | ||||
| 342 | }, | ||||
| 343 | default => "new", | ||||
| 344 | _definition_context(), | ||||
| 345 | )) | ||||
| 346 | ); | ||||
| 347 | |||||
| 348 | 1 | 6µs | 4 | 188µs | Class::MOP::Class->meta->add_attribute( # spent 165µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 349 | Class::MOP::Attribute->new('constructor_class' => ( | ||||
| 350 | reader => { | ||||
| 351 | 'constructor_class' => \&Class::MOP::Class::constructor_class, | ||||
| 352 | }, | ||||
| 353 | default => "Class::MOP::Method::Constructor", | ||||
| 354 | _definition_context(), | ||||
| 355 | )) | ||||
| 356 | ); | ||||
| 357 | |||||
| 358 | |||||
| 359 | 1 | 6µs | 4 | 195µs | Class::MOP::Class->meta->add_attribute( # spent 173µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 360 | Class::MOP::Attribute->new('destructor_class' => ( | ||||
| 361 | reader => { | ||||
| 362 | 'destructor_class' => \&Class::MOP::Class::destructor_class, | ||||
| 363 | }, | ||||
| 364 | _definition_context(), | ||||
| 365 | )) | ||||
| 366 | ); | ||||
| 367 | |||||
| 368 | # NOTE: | ||||
| 369 | # we don't actually need to tie the knot with | ||||
| 370 | # Class::MOP::Class here, it is actually handled | ||||
| 371 | # within Class::MOP::Class itself in the | ||||
| 372 | # _construct_class_instance method. | ||||
| 373 | |||||
| 374 | ## -------------------------------------------------------- | ||||
| 375 | ## Class::MOP::Mixin::AttributeCore | ||||
| 376 | 1 | 9µs | 4 | 436µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 220µs making 1 call to Class::MOP::Mixin::meta
# spent 201µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 377 | Class::MOP::Attribute->new('name' => ( | ||||
| 378 | reader => { | ||||
| 379 | # NOTE: we need to do this in order | ||||
| 380 | # for the instance meta-object to | ||||
| 381 | # not fall into meta-circular death | ||||
| 382 | # | ||||
| 383 | # we just alias the original method | ||||
| 384 | # rather than re-produce it here | ||||
| 385 | 'name' => \&Class::MOP::Mixin::AttributeCore::name | ||||
| 386 | }, | ||||
| 387 | _definition_context(), | ||||
| 388 | )) | ||||
| 389 | ); | ||||
| 390 | |||||
| 391 | 1 | 6µs | 4 | 303µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 279µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 392 | Class::MOP::Attribute->new('accessor' => ( | ||||
| 393 | reader => { 'accessor' => \&Class::MOP::Mixin::AttributeCore::accessor }, | ||||
| 394 | predicate => { 'has_accessor' => \&Class::MOP::Mixin::AttributeCore::has_accessor }, | ||||
| 395 | _definition_context(), | ||||
| 396 | )) | ||||
| 397 | ); | ||||
| 398 | |||||
| 399 | 1 | 6µs | 4 | 290µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 266µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 400 | Class::MOP::Attribute->new('reader' => ( | ||||
| 401 | reader => { 'reader' => \&Class::MOP::Mixin::AttributeCore::reader }, | ||||
| 402 | predicate => { 'has_reader' => \&Class::MOP::Mixin::AttributeCore::has_reader }, | ||||
| 403 | _definition_context(), | ||||
| 404 | )) | ||||
| 405 | ); | ||||
| 406 | |||||
| 407 | 1 | 8µs | 4 | 285µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 262µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 408 | Class::MOP::Attribute->new('initializer' => ( | ||||
| 409 | reader => { 'initializer' => \&Class::MOP::Mixin::AttributeCore::initializer }, | ||||
| 410 | predicate => { 'has_initializer' => \&Class::MOP::Mixin::AttributeCore::has_initializer }, | ||||
| 411 | _definition_context(), | ||||
| 412 | )) | ||||
| 413 | ); | ||||
| 414 | |||||
| 415 | 1 | 6µs | 4 | 195µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 174µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 416 | Class::MOP::Attribute->new('definition_context' => ( | ||||
| 417 | reader => { 'definition_context' => \&Class::MOP::Mixin::AttributeCore::definition_context }, | ||||
| 418 | _definition_context(), | ||||
| 419 | )) | ||||
| 420 | ); | ||||
| 421 | |||||
| 422 | 1 | 6µs | 4 | 288µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 265µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 423 | Class::MOP::Attribute->new('writer' => ( | ||||
| 424 | reader => { 'writer' => \&Class::MOP::Mixin::AttributeCore::writer }, | ||||
| 425 | predicate => { 'has_writer' => \&Class::MOP::Mixin::AttributeCore::has_writer }, | ||||
| 426 | _definition_context(), | ||||
| 427 | )) | ||||
| 428 | ); | ||||
| 429 | |||||
| 430 | 1 | 6µs | 4 | 298µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 276µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 431 | Class::MOP::Attribute->new('predicate' => ( | ||||
| 432 | reader => { 'predicate' => \&Class::MOP::Mixin::AttributeCore::predicate }, | ||||
| 433 | predicate => { 'has_predicate' => \&Class::MOP::Mixin::AttributeCore::has_predicate }, | ||||
| 434 | _definition_context(), | ||||
| 435 | )) | ||||
| 436 | ); | ||||
| 437 | |||||
| 438 | 1 | 7µs | 4 | 284µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 261µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 7µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 439 | Class::MOP::Attribute->new('clearer' => ( | ||||
| 440 | reader => { 'clearer' => \&Class::MOP::Mixin::AttributeCore::clearer }, | ||||
| 441 | predicate => { 'has_clearer' => \&Class::MOP::Mixin::AttributeCore::has_clearer }, | ||||
| 442 | _definition_context(), | ||||
| 443 | )) | ||||
| 444 | ); | ||||
| 445 | |||||
| 446 | 1 | 6µs | 4 | 301µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 280µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 7µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 447 | Class::MOP::Attribute->new('builder' => ( | ||||
| 448 | reader => { 'builder' => \&Class::MOP::Mixin::AttributeCore::builder }, | ||||
| 449 | predicate => { 'has_builder' => \&Class::MOP::Mixin::AttributeCore::has_builder }, | ||||
| 450 | _definition_context(), | ||||
| 451 | )) | ||||
| 452 | ); | ||||
| 453 | |||||
| 454 | 1 | 9µs | 4 | 292µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 268µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 455 | Class::MOP::Attribute->new('init_arg' => ( | ||||
| 456 | reader => { 'init_arg' => \&Class::MOP::Mixin::AttributeCore::init_arg }, | ||||
| 457 | predicate => { 'has_init_arg' => \&Class::MOP::Mixin::AttributeCore::has_init_arg }, | ||||
| 458 | _definition_context(), | ||||
| 459 | )) | ||||
| 460 | ); | ||||
| 461 | |||||
| 462 | 1 | 5µs | 4 | 204µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 182µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 7µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 463 | Class::MOP::Attribute->new('default' => ( | ||||
| 464 | # default has a custom 'reader' method ... | ||||
| 465 | predicate => { 'has_default' => \&Class::MOP::Mixin::AttributeCore::has_default }, | ||||
| 466 | _definition_context(), | ||||
| 467 | )) | ||||
| 468 | ); | ||||
| 469 | |||||
| 470 | 1 | 6µs | 4 | 390µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 367µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 471 | Class::MOP::Attribute->new('insertion_order' => ( | ||||
| 472 | reader => { 'insertion_order' => \&Class::MOP::Mixin::AttributeCore::insertion_order }, | ||||
| 473 | writer => { '_set_insertion_order' => \&Class::MOP::Mixin::AttributeCore::_set_insertion_order }, | ||||
| 474 | predicate => { 'has_insertion_order' => \&Class::MOP::Mixin::AttributeCore::has_insertion_order }, | ||||
| 475 | _definition_context(), | ||||
| 476 | )) | ||||
| 477 | ); | ||||
| 478 | |||||
| 479 | ## -------------------------------------------------------- | ||||
| 480 | ## Class::MOP::Attribute | ||||
| 481 | 1 | 7µs | 4 | 517µs | Class::MOP::Attribute->meta->add_attribute( # spent 299µs making 1 call to Class::MOP::Mixin::meta
# spent 203µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 482 | Class::MOP::Attribute->new('associated_class' => ( | ||||
| 483 | reader => { | ||||
| 484 | # NOTE: we need to do this in order | ||||
| 485 | # for the instance meta-object to | ||||
| 486 | # not fall into meta-circular death | ||||
| 487 | # | ||||
| 488 | # we just alias the original method | ||||
| 489 | # rather than re-produce it here | ||||
| 490 | 'associated_class' => \&Class::MOP::Attribute::associated_class | ||||
| 491 | }, | ||||
| 492 | _definition_context(), | ||||
| 493 | )) | ||||
| 494 | ); | ||||
| 495 | |||||
| 496 | Class::MOP::Attribute->meta->add_attribute( | ||||
| 497 | Class::MOP::Attribute->new('associated_methods' => ( | ||||
| 498 | reader => { 'associated_methods' => \&Class::MOP::Attribute::associated_methods }, | ||||
| 499 | 109 | 5.52ms | # spent 176µs within Class::MOP::__ANON__[/usr/local/lib/perl/5.18.2/Class/MOP.pm:499] which was called 109 times, avg 2µs/call:
# 76 times (126µs+0s) by Moose::Meta::Attribute::_new at line 21 of (eval 45)[Eval/Closure.pm:144], avg 2µs/call
# 33 times (51µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 40 of Class/MOP/Mixin/AttributeCore.pm, avg 2µs/call | ||
| 500 | 1 | 7µs | 4 | 199µs | _definition_context(), # spent 169µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 19µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 501 | )) | ||||
| 502 | ); | ||||
| 503 | |||||
| 504 | Class::MOP::Attribute->meta->add_method('clone' => sub { | ||||
| 505 | my $self = shift; | ||||
| 506 | $self->meta->clone_object($self, @_); | ||||
| 507 | 1 | 4µs | 2 | 50µs | }); # spent 42µs making 1 call to Class::MOP::Mixin::HasMethods::add_method
# spent 8µs making 1 call to Class::MOP::Mixin::meta |
| 508 | |||||
| 509 | ## -------------------------------------------------------- | ||||
| 510 | ## Class::MOP::Method | ||||
| 511 | 1 | 8µs | 4 | 389µs | Class::MOP::Method->meta->add_attribute( # spent 190µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 184µs making 1 call to Class::MOP::Mixin::meta
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 512 | Class::MOP::Attribute->new('body' => ( | ||||
| 513 | reader => { 'body' => \&Class::MOP::Method::body }, | ||||
| 514 | _definition_context(), | ||||
| 515 | )) | ||||
| 516 | ); | ||||
| 517 | |||||
| 518 | 1 | 6µs | 4 | 277µs | Class::MOP::Method->meta->add_attribute( # spent 255µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 519 | Class::MOP::Attribute->new('associated_metaclass' => ( | ||||
| 520 | reader => { 'associated_metaclass' => \&Class::MOP::Method::associated_metaclass }, | ||||
| 521 | _definition_context(), | ||||
| 522 | )) | ||||
| 523 | ); | ||||
| 524 | |||||
| 525 | 1 | 7µs | 4 | 269µs | Class::MOP::Method->meta->add_attribute( # spent 246µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 526 | Class::MOP::Attribute->new('package_name' => ( | ||||
| 527 | reader => { 'package_name' => \&Class::MOP::Method::package_name }, | ||||
| 528 | _definition_context(), | ||||
| 529 | )) | ||||
| 530 | ); | ||||
| 531 | |||||
| 532 | 1 | 6µs | 4 | 273µs | Class::MOP::Method->meta->add_attribute( # spent 250µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 533 | Class::MOP::Attribute->new('name' => ( | ||||
| 534 | reader => { 'name' => \&Class::MOP::Method::name }, | ||||
| 535 | _definition_context(), | ||||
| 536 | )) | ||||
| 537 | ); | ||||
| 538 | |||||
| 539 | 1 | 8µs | 4 | 3.16ms | Class::MOP::Method->meta->add_attribute( # spent 3.14ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 540 | Class::MOP::Attribute->new('original_method' => ( | ||||
| 541 | reader => { 'original_method' => \&Class::MOP::Method::original_method }, | ||||
| 542 | writer => { '_set_original_method' => \&Class::MOP::Method::_set_original_method }, | ||||
| 543 | _definition_context(), | ||||
| 544 | )) | ||||
| 545 | ); | ||||
| 546 | |||||
| 547 | ## -------------------------------------------------------- | ||||
| 548 | ## Class::MOP::Method::Wrapped | ||||
| 549 | |||||
| 550 | # NOTE: | ||||
| 551 | # the way this item is initialized, this | ||||
| 552 | # really does not follow the standard | ||||
| 553 | # practices of attributes, but we put | ||||
| 554 | # it here for completeness | ||||
| 555 | 1 | 8µs | 4 | 303µs | Class::MOP::Method::Wrapped->meta->add_attribute( # spent 206µs making 1 call to Class::MOP::Mixin::meta
# spent 80µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 5µs making 1 call to Class::MOP::_definition_context |
| 556 | Class::MOP::Attribute->new('modifier_table' => ( | ||||
| 557 | _definition_context(), | ||||
| 558 | )) | ||||
| 559 | ); | ||||
| 560 | |||||
| 561 | ## -------------------------------------------------------- | ||||
| 562 | ## Class::MOP::Method::Generated | ||||
| 563 | |||||
| 564 | 1 | 10µs | 4 | 471µs | Class::MOP::Method::Generated->meta->add_attribute( # spent 261µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 193µs making 1 call to Class::MOP::Mixin::meta
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 565 | Class::MOP::Attribute->new('is_inline' => ( | ||||
| 566 | reader => { 'is_inline' => \&Class::MOP::Method::Generated::is_inline }, | ||||
| 567 | default => 0, | ||||
| 568 | _definition_context(), | ||||
| 569 | )) | ||||
| 570 | ); | ||||
| 571 | |||||
| 572 | 1 | 5µs | 4 | 271µs | Class::MOP::Method::Generated->meta->add_attribute( # spent 248µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 573 | Class::MOP::Attribute->new('definition_context' => ( | ||||
| 574 | reader => { 'definition_context' => \&Class::MOP::Method::Generated::definition_context }, | ||||
| 575 | _definition_context(), | ||||
| 576 | )) | ||||
| 577 | ); | ||||
| 578 | |||||
| 579 | |||||
| 580 | ## -------------------------------------------------------- | ||||
| 581 | ## Class::MOP::Method::Inlined | ||||
| 582 | |||||
| 583 | 1 | 10µs | 4 | 459µs | Class::MOP::Method::Inlined->meta->add_attribute( # spent 251µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 192µs making 1 call to Class::MOP::Mixin::meta
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 584 | Class::MOP::Attribute->new('_expected_method_class' => ( | ||||
| 585 | reader => { '_expected_method_class' => \&Class::MOP::Method::Inlined::_expected_method_class }, | ||||
| 586 | _definition_context(), | ||||
| 587 | )) | ||||
| 588 | ); | ||||
| 589 | |||||
| 590 | ## -------------------------------------------------------- | ||||
| 591 | ## Class::MOP::Method::Accessor | ||||
| 592 | |||||
| 593 | 1 | 8µs | 4 | 389µs | Class::MOP::Method::Accessor->meta->add_attribute( # spent 190µs making 1 call to Class::MOP::Mixin::meta
# spent 184µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 594 | Class::MOP::Attribute->new('attribute' => ( | ||||
| 595 | reader => { | ||||
| 596 | 'associated_attribute' => \&Class::MOP::Method::Accessor::associated_attribute | ||||
| 597 | }, | ||||
| 598 | _definition_context(), | ||||
| 599 | )) | ||||
| 600 | ); | ||||
| 601 | |||||
| 602 | 1 | 6µs | 4 | 265µs | Class::MOP::Method::Accessor->meta->add_attribute( # spent 242µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 603 | Class::MOP::Attribute->new('accessor_type' => ( | ||||
| 604 | reader => { 'accessor_type' => \&Class::MOP::Method::Accessor::accessor_type }, | ||||
| 605 | _definition_context(), | ||||
| 606 | )) | ||||
| 607 | ); | ||||
| 608 | |||||
| 609 | ## -------------------------------------------------------- | ||||
| 610 | ## Class::MOP::Method::Constructor | ||||
| 611 | |||||
| 612 | Class::MOP::Method::Constructor->meta->add_attribute( | ||||
| 613 | Class::MOP::Attribute->new('options' => ( | ||||
| 614 | reader => { | ||||
| 615 | 'options' => \&Class::MOP::Method::Constructor::options | ||||
| 616 | }, | ||||
| 617 | default => sub { +{} }, | ||||
| 618 | 1 | 11µs | 4 | 471µs | _definition_context(), # spent 264µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 186µs making 1 call to Class::MOP::Mixin::meta
# spent 17µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 619 | )) | ||||
| 620 | ); | ||||
| 621 | |||||
| 622 | 1 | 7µs | 4 | 190µs | Class::MOP::Method::Constructor->meta->add_attribute( # spent 165µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 623 | Class::MOP::Attribute->new('associated_metaclass' => ( | ||||
| 624 | init_arg => "metaclass", # FIXME alias and rename | ||||
| 625 | reader => { | ||||
| 626 | 'associated_metaclass' => \&Class::MOP::Method::Constructor::associated_metaclass | ||||
| 627 | }, | ||||
| 628 | _definition_context(), | ||||
| 629 | )) | ||||
| 630 | ); | ||||
| 631 | |||||
| 632 | ## -------------------------------------------------------- | ||||
| 633 | ## Class::MOP::Overload | ||||
| 634 | |||||
| 635 | 1 | 9µs | 4 | 391µs | Class::MOP::Overload->meta->add_attribute( # spent 190µs making 1 call to Class::MOP::Mixin::meta
# spent 184µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
| 636 | Class::MOP::Attribute->new( | ||||
| 637 | 'operator' => ( | ||||
| 638 | reader => { 'operator' => \&Class::MOP::Overload::operator }, | ||||
| 639 | required => 1, | ||||
| 640 | _definition_context(), | ||||
| 641 | ) | ||||
| 642 | ) | ||||
| 643 | ); | ||||
| 644 | |||||
| 645 | 1 | 1µs | for my $attr (qw( method_name coderef coderef_package coderef_name method )) { | ||
| 646 | 5 | 53µs | 30 | 1.36ms | Class::MOP::Overload->meta->add_attribute( # spent 1.24ms making 5 calls to Class::MOP::Mixin::HasAttributes::add_attribute, avg 248µs/call
# spent 61µs making 5 calls to Class::MOP::Attribute::new, avg 12µs/call
# spent 39µs making 5 calls to Class::MOP::Mixin::meta, avg 8µs/call
# spent 16µs making 5 calls to Class::MOP::_definition_context, avg 3µs/call
# spent 8µs making 10 calls to UNIVERSAL::can, avg 820ns/call |
| 647 | Class::MOP::Attribute->new( | ||||
| 648 | $attr => ( | ||||
| 649 | reader => { $attr => Class::MOP::Overload->can($attr) }, | ||||
| 650 | predicate => { | ||||
| 651 | 'has_' | ||||
| 652 | . $attr => Class::MOP::Overload->can( 'has_' . $attr ) | ||||
| 653 | }, | ||||
| 654 | _definition_context(), | ||||
| 655 | ) | ||||
| 656 | ) | ||||
| 657 | ); | ||||
| 658 | } | ||||
| 659 | |||||
| 660 | Class::MOP::Overload->meta->add_attribute( | ||||
| 661 | 1 | 6µs | 4 | 179µs | Class::MOP::Attribute->new( # spent 158µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 7µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 662 | 'associated_metaclass' => ( | ||||
| 663 | reader => { | ||||
| 664 | 'associated_metaclass' => | ||||
| 665 | \&Class::MOP::Overload::associated_metaclass | ||||
| 666 | }, | ||||
| 667 | _definition_context(), | ||||
| 668 | ) | ||||
| 669 | ) | ||||
| 670 | ); | ||||
| 671 | |||||
| 672 | ## -------------------------------------------------------- | ||||
| 673 | ## Class::MOP::Instance | ||||
| 674 | |||||
| 675 | # NOTE: | ||||
| 676 | # these don't yet do much of anything, but are just | ||||
| 677 | # included for completeness | ||||
| 678 | |||||
| 679 | 1 | 8µs | 4 | 400µs | Class::MOP::Instance->meta->add_attribute( # spent 197µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 186µs making 1 call to Class::MOP::Mixin::meta
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 680 | Class::MOP::Attribute->new('associated_metaclass', | ||||
| 681 | reader => { associated_metaclass => \&Class::MOP::Instance::associated_metaclass }, | ||||
| 682 | _definition_context(), | ||||
| 683 | ), | ||||
| 684 | ); | ||||
| 685 | |||||
| 686 | 1 | 5µs | 4 | 180µs | Class::MOP::Instance->meta->add_attribute( # spent 157µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 687 | Class::MOP::Attribute->new('_class_name', | ||||
| 688 | init_arg => undef, | ||||
| 689 | reader => { _class_name => \&Class::MOP::Instance::_class_name }, | ||||
| 690 | #lazy => 1, # not yet supported by Class::MOP but out our version does it anyway | ||||
| 691 | #default => sub { $_[0]->associated_metaclass->name }, | ||||
| 692 | _definition_context(), | ||||
| 693 | ), | ||||
| 694 | ); | ||||
| 695 | |||||
| 696 | 1 | 6µs | 4 | 189µs | Class::MOP::Instance->meta->add_attribute( # spent 167µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 697 | Class::MOP::Attribute->new('attributes', | ||||
| 698 | reader => { attributes => \&Class::MOP::Instance::get_all_attributes }, | ||||
| 699 | _definition_context(), | ||||
| 700 | ), | ||||
| 701 | ); | ||||
| 702 | |||||
| 703 | 1 | 6µs | 4 | 204µs | Class::MOP::Instance->meta->add_attribute( # spent 182µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 704 | Class::MOP::Attribute->new('slots', | ||||
| 705 | reader => { slots => \&Class::MOP::Instance::slots }, | ||||
| 706 | _definition_context(), | ||||
| 707 | ), | ||||
| 708 | ); | ||||
| 709 | |||||
| 710 | 1 | 7µs | 4 | 202µs | Class::MOP::Instance->meta->add_attribute( # spent 181µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 3µs making 1 call to Class::MOP::_definition_context |
| 711 | Class::MOP::Attribute->new('slot_hash', | ||||
| 712 | reader => { slot_hash => \&Class::MOP::Instance::slot_hash }, | ||||
| 713 | _definition_context(), | ||||
| 714 | ), | ||||
| 715 | ); | ||||
| 716 | |||||
| 717 | ## -------------------------------------------------------- | ||||
| 718 | ## Class::MOP::Object | ||||
| 719 | |||||
| 720 | # need to replace the meta method there with a real meta method object | ||||
| 721 | 1 | 10µs | 2 | 940µs | Class::MOP::Object->meta->_add_meta_method('meta'); # spent 932µs making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method
# spent 8µs making 1 call to Class::MOP::Mixin::meta |
| 722 | |||||
| 723 | ## -------------------------------------------------------- | ||||
| 724 | ## Class::MOP::Mixin | ||||
| 725 | |||||
| 726 | # need to replace the meta method there with a real meta method object | ||||
| 727 | 1 | 5µs | 2 | 462µs | Class::MOP::Mixin->meta->_add_meta_method('meta'); # spent 454µs making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method
# spent 8µs making 1 call to Class::MOP::Mixin::meta |
| 728 | |||||
| 729 | 1 | 119µs | require Class::MOP::Deprecated unless our $no_deprecated; | ||
| 730 | |||||
| 731 | # we need the meta instance of the meta instance to be created now, in order | ||||
| 732 | # for the constructor to be able to use it | ||||
| 733 | 1 | 15µs | 2 | 125µs | Class::MOP::Instance->meta->get_meta_instance; # spent 107µs making 1 call to Class::MOP::Class::get_meta_instance
# spent 18µs making 1 call to Class::MOP::Object::meta |
| 734 | |||||
| 735 | # pretend the add_method never happened. it hasn't yet affected anything | ||||
| 736 | 1 | 2µs | 1 | 7µs | undef Class::MOP::Instance->meta->{_package_cache_flag}; # spent 7µs making 1 call to Class::MOP::Object::meta |
| 737 | |||||
| 738 | ## -------------------------------------------------------- | ||||
| 739 | ## Now close all the Class::MOP::* classes | ||||
| 740 | |||||
| 741 | # NOTE: we don't need to inline the accessors this only lengthens the compile | ||||
| 742 | # time of the MOP, and gives us no actual benefits. | ||||
| 743 | |||||
| 744 | $_->meta->make_immutable( | ||||
| 745 | inline_constructor => 0, | ||||
| 746 | constructor_name => "_new", | ||||
| 747 | inline_accessors => 0, | ||||
| 748 | 1 | 49µs | 28 | 14.6ms | ) for qw/ # spent 14.5ms making 14 calls to Class::MOP::Class::make_immutable, avg 1.03ms/call
# spent 96µs making 14 calls to Class::MOP::Object::meta, avg 7µs/call |
| 749 | Class::MOP::Package | ||||
| 750 | Class::MOP::Module | ||||
| 751 | Class::MOP::Class | ||||
| 752 | |||||
| 753 | Class::MOP::Attribute | ||||
| 754 | Class::MOP::Method | ||||
| 755 | Class::MOP::Instance | ||||
| 756 | |||||
| 757 | Class::MOP::Object | ||||
| 758 | |||||
| 759 | Class::MOP::Method::Generated | ||||
| 760 | Class::MOP::Method::Inlined | ||||
| 761 | |||||
| 762 | Class::MOP::Method::Accessor | ||||
| 763 | Class::MOP::Method::Constructor | ||||
| 764 | Class::MOP::Method::Wrapped | ||||
| 765 | |||||
| 766 | Class::MOP::Method::Meta | ||||
| 767 | |||||
| 768 | Class::MOP::Overload | ||||
| 769 | /; | ||||
| 770 | |||||
| 771 | $_->meta->make_immutable( | ||||
| 772 | inline_constructor => 0, | ||||
| 773 | constructor_name => undef, | ||||
| 774 | inline_accessors => 0, | ||||
| 775 | 1 | 20µs | 10 | 392µs | ) for qw/ # spent 355µs making 5 calls to Class::MOP::Class::make_immutable, avg 71µs/call
# spent 36µs making 5 calls to Class::MOP::Mixin::meta, avg 7µs/call |
| 776 | Class::MOP::Mixin | ||||
| 777 | Class::MOP::Mixin::AttributeCore | ||||
| 778 | Class::MOP::Mixin::HasAttributes | ||||
| 779 | Class::MOP::Mixin::HasMethods | ||||
| 780 | Class::MOP::Mixin::HasOverloads | ||||
| 781 | /; | ||||
| 782 | |||||
| 783 | 1 | 130µs | 1; | ||
| 784 | |||||
| 785 | # ABSTRACT: A Meta Object Protocol for Perl 5 | ||||
| 786 | |||||
| 787 | __END__ | ||||
# spent 32µs within Class::MOP::__ANON__ which was called 50 times, avg 640ns/call:
# 50 times (32µs+0s) by Class::MOP::Class::class_precedence_list at line 1014 of Class/MOP/Class.pm, avg 640ns/call | |||||
# spent 1.38ms within Class::MOP::get_code_info which was called 1583 times, avg 870ns/call:
# 1263 times (1.14ms+0s) by Class::MOP::Mixin::HasMethods::add_method at line 73 of Class/MOP/Mixin/HasMethods.pm, avg 904ns/call
# 296 times (207µs+0s) by Class::MOP::Mixin::HasMethods::_code_is_mine at line 87 of Class/MOP/Mixin/HasMethods.pm, avg 701ns/call
# 24 times (29µs+0s) by Moose::Meta::Role::Application::ToClass::apply_override_method_modifiers at line 192 of Moose/Meta/Role/Application/ToClass.pm, avg 1µs/call |