| Filename | /home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm |
| Statements | Executed 26763 statements in 356ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 45 | 1 | 1 | 84.2ms | 4.01s | Class::MOP::__ANON__[:118] |
| 8511 | 9 | 6 | 78.0ms | 78.0ms | Class::MOP::get_metaclass_by_name |
| 642 | 2 | 2 | 54.9ms | 3.48s | Class::MOP::load_first_existing_class (recurses: max depth 3, inclusive time 685ms) |
| 1438 | 17 | 9 | 38.6ms | 46.0ms | Class::MOP::class_of |
| 4012 | 4 | 3 | 31.2ms | 31.2ms | Class::MOP::get_code_info (xsub) |
| 1 | 1 | 1 | 24.7ms | 110ms | Class::MOP::BEGIN@19 |
| 719 | 2 | 2 | 20.8ms | 35.5ms | Class::MOP::_is_valid_class_name |
| 632 | 12 | 11 | 17.9ms | 3.48s | Class::MOP::load_class (recurses: max depth 3, inclusive time 689ms) |
| 724 | 2 | 1 | 14.7ms | 14.7ms | Class::MOP::CORE:match (opcode) |
| 748 | 5 | 3 | 13.6ms | 13.6ms | Class::MOP::is_class_loaded (xsub) |
| 505 | 3 | 1 | 9.98ms | 12.9ms | Class::MOP::metaclass_is_weak |
| 1 | 1 | 1 | 8.66ms | 10.0ms | Class::MOP::BEGIN@20 |
| 1 | 1 | 1 | 5.04ms | 7.81ms | Class::MOP::BEGIN@9 |
| 1 | 1 | 1 | 4.20ms | 22.8ms | Class::MOP::BEGIN@18 |
| 1 | 1 | 1 | 3.91ms | 4.20ms | Class::MOP::BEGIN@11 |
| 264 | 2 | 2 | 3.59ms | 3.59ms | Class::MOP::store_metaclass_by_name |
| 1 | 1 | 1 | 3.13ms | 5.24ms | Class::MOP::BEGIN@12 |
| 1 | 1 | 1 | 2.37ms | 38.9ms | Class::MOP::BEGIN@13 |
| 1 | 1 | 1 | 2.35ms | 3.34ms | Class::MOP::BEGIN@14 |
| 1 | 1 | 1 | 2.24ms | 3.10ms | Class::MOP::BEGIN@17 |
| 1 | 1 | 1 | 2.15ms | 4.31ms | Class::MOP::BEGIN@16 |
| 196 | 3 | 2 | 2.00ms | 2.00ms | Class::MOP::__ANON__[:234] |
| 196 | 3 | 2 | 1.99ms | 1.99ms | Class::MOP::__ANON__[:276] |
| 196 | 3 | 2 | 1.95ms | 1.95ms | Class::MOP::__ANON__[:321] |
| 193 | 2 | 2 | 1.89ms | 1.89ms | Class::MOP::__ANON__[:192] |
| 196 | 3 | 2 | 1.82ms | 1.82ms | Class::MOP::__ANON__[:302] |
| 294 | 1 | 1 | 1.53ms | 1.53ms | Class::MOP::__ANON__ (xsub) |
| 45 | 1 | 1 | 1.29ms | 1.89ms | Class::MOP::_class_to_pmfile |
| 111 | 1 | 1 | 1.13ms | 1.13ms | Class::MOP::__ANON__[:337] |
| 44 | 2 | 2 | 871µs | 1.33ms | Class::MOP::weaken_metaclass |
| 72 | 3 | 2 | 823µs | 823µs | Class::MOP::__ANON__[:510] |
| 45 | 1 | 1 | 600µs | 600µs | Class::MOP::CORE:subst (opcode) |
| 1 | 1 | 1 | 581µs | 581µs | Class::MOP::bootstrap (xsub) |
| 42 | 1 | 1 | 515µs | 515µs | Class::MOP::remove_metaclass_by_name |
| 5 | 1 | 1 | 208µs | 208µs | Class::MOP::CORE:regcomp (opcode) |
| 5 | 1 | 1 | 190µs | 443µs | Class::MOP::__ANON__[:125] |
| 1 | 1 | 1 | 70µs | 70µs | Class::MOP::BEGIN@7 |
| 1 | 1 | 1 | 69µs | 83µs | Class::MOP::BEGIN@4 |
| 1 | 1 | 1 | 38µs | 114µs | Class::MOP::BEGIN@5 |
| 1 | 1 | 1 | 34µs | 34µs | Class::MOP::BEGIN@21 |
| 1 | 1 | 1 | 29µs | 29µs | Class::MOP::BEGIN@23 |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::__ANON__[:517] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::__ANON__[:615] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::does_metaclass_exist |
| 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 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | package Class::MOP; | ||||
| 3 | |||||
| 4 | 3 | 102µs | 2 | 97µs | # spent 83µs (69+14) within Class::MOP::BEGIN@4 which was called:
# once (69µs+14µs) by MooseX::Types::Combine::BEGIN@12 at line 4 # spent 83µs making 1 call to Class::MOP::BEGIN@4
# spent 14µs making 1 call to strict::import |
| 5 | 3 | 94µs | 2 | 189µs | # spent 114µs (38+76) within Class::MOP::BEGIN@5 which was called:
# once (38µs+76µs) by MooseX::Types::Combine::BEGIN@12 at line 5 # spent 114µs making 1 call to Class::MOP::BEGIN@5
# spent 76µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 3 | 130µs | 1 | 70µs | # spent 70µs within Class::MOP::BEGIN@7 which was called:
# once (70µs+0s) by MooseX::Types::Combine::BEGIN@12 at line 7 # spent 70µs making 1 call to Class::MOP::BEGIN@7 |
| 8 | |||||
| 9 | 3 | 586µs | 1 | 7.81ms | # spent 7.81ms (5.04+2.77) within Class::MOP::BEGIN@9 which was called:
# once (5.04ms+2.77ms) by MooseX::Types::Combine::BEGIN@12 at line 9 # spent 7.81ms making 1 call to Class::MOP::BEGIN@9 |
| 10 | |||||
| 11 | 3 | 1.59ms | 2 | 4.48ms | # spent 4.20ms (3.91+286µs) within Class::MOP::BEGIN@11 which was called:
# once (3.91ms+286µs) by MooseX::Types::Combine::BEGIN@12 at line 11 # spent 4.20ms making 1 call to Class::MOP::BEGIN@11
# spent 286µs making 1 call to Exporter::import |
| 12 | 3 | 586µs | 2 | 5.63ms | # spent 5.24ms (3.13+2.11) within Class::MOP::BEGIN@12 which was called:
# once (3.13ms+2.11ms) by MooseX::Types::Combine::BEGIN@12 at line 12 # spent 5.24ms making 1 call to Class::MOP::BEGIN@12
# spent 391µs making 1 call to Exporter::import |
| 13 | 3 | 564µs | 2 | 38.9ms | # spent 38.9ms (2.37+36.5) within Class::MOP::BEGIN@13 which was called:
# once (2.37ms+36.5ms) by MooseX::Types::Combine::BEGIN@12 at line 13 # spent 38.9ms making 1 call to Class::MOP::BEGIN@13
# spent 24µs making 1 call to Sub::Install::__ANON__[Sub/Install.pm:284] |
| 14 | 3 | 626µs | 2 | 3.56ms | # spent 3.34ms (2.35+988µs) within Class::MOP::BEGIN@14 which was called:
# once (2.35ms+988µs) by MooseX::Types::Combine::BEGIN@12 at line 14 # spent 3.34ms making 1 call to Class::MOP::BEGIN@14
# spent 220µs making 1 call to Exporter::import |
| 15 | |||||
| 16 | 3 | 462µs | 1 | 4.31ms | # spent 4.31ms (2.15+2.15) within Class::MOP::BEGIN@16 which was called:
# once (2.15ms+2.15ms) by MooseX::Types::Combine::BEGIN@12 at line 16 # spent 4.31ms making 1 call to Class::MOP::BEGIN@16 |
| 17 | 3 | 436µs | 1 | 3.10ms | # spent 3.10ms (2.24+863µs) within Class::MOP::BEGIN@17 which was called:
# once (2.24ms+863µs) by MooseX::Types::Combine::BEGIN@12 at line 17 # spent 3.10ms making 1 call to Class::MOP::BEGIN@17 |
| 18 | 3 | 450µs | 1 | 22.8ms | # spent 22.8ms (4.20+18.6) within Class::MOP::BEGIN@18 which was called:
# once (4.20ms+18.6ms) by MooseX::Types::Combine::BEGIN@12 at line 18 # spent 22.8ms making 1 call to Class::MOP::BEGIN@18 |
| 19 | 3 | 439µs | 1 | 110ms | # spent 110ms (24.7+85.0) within Class::MOP::BEGIN@19 which was called:
# once (24.7ms+85.0ms) by MooseX::Types::Combine::BEGIN@12 at line 19 # spent 110ms making 1 call to Class::MOP::BEGIN@19 |
| 20 | 3 | 448µs | 1 | 10.0ms | # spent 10.0ms (8.66+1.36) within Class::MOP::BEGIN@20 which was called:
# once (8.66ms+1.36ms) by MooseX::Types::Combine::BEGIN@12 at line 20 # spent 10.0ms making 1 call to Class::MOP::BEGIN@20 |
| 21 | 3 | 270µs | 1 | 34µs | # spent 34µs within Class::MOP::BEGIN@21 which was called:
# once (34µs+0s) by MooseX::Types::Combine::BEGIN@12 at line 21 # spent 34µs making 1 call to Class::MOP::BEGIN@21 |
| 22 | |||||
| 23 | # spent 29µs within Class::MOP::BEGIN@23 which was called:
# once (29µs+0s) by MooseX::Types::Combine::BEGIN@12 at line 30 | ||||
| 24 | *IS_RUNNING_ON_5_10 = ($] < 5.009_005) | ||||
| 25 | ? sub () { 0 } | ||||
| 26 | 2 | 32µs | : sub () { 1 }; | ||
| 27 | |||||
| 28 | # this is either part of core or set up appropriately by MRO::Compat | ||||
| 29 | *check_package_cache_flag = \&mro::get_pkg_gen; | ||||
| 30 | 1 | 8.20ms | 1 | 29µs | } # spent 29µs making 1 call to Class::MOP::BEGIN@23 |
| 31 | |||||
| 32 | 1 | 6µs | our $VERSION = '1.11'; | ||
| 33 | 1 | 3µs | our $XS_VERSION = $VERSION; | ||
| 34 | 1 | 97µs | $VERSION = eval $VERSION; # spent 12µs executing statements in string eval | ||
| 35 | 1 | 4µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 36 | |||||
| 37 | 1 | 4µs | require XSLoader; | ||
| 38 | 1 | 259µs | 1 | 227µs | XSLoader::load( __PACKAGE__, $XS_VERSION ); # spent 227µs making 1 call to XSLoader::load |
| 39 | |||||
| 40 | { | ||||
| 41 | # Metaclasses are singletons, so we cache them here. | ||||
| 42 | # there is no need to worry about destruction though | ||||
| 43 | # because they should die only when the program dies. | ||||
| 44 | # After all, do package definitions even get reaped? | ||||
| 45 | # Anonymous classes manage their own destruction. | ||||
| 46 | 2 | 7µs | my %METAS; | ||
| 47 | |||||
| 48 | sub get_all_metaclasses { %METAS } | ||||
| 49 | sub get_all_metaclass_instances { values %METAS } | ||||
| 50 | sub get_all_metaclass_names { keys %METAS } | ||||
| 51 | 8511 | 110ms | # spent 78.0ms within Class::MOP::get_metaclass_by_name which was called 8511 times, avg 9µs/call:
# 6665 times (61.9ms+0s) by Class::MOP::Class::initialize at line 45 of Class/MOP/Class.pm, avg 9µs/call
# 1141 times (9.60ms+0s) by Class::MOP::Class::_single_metaclass_is_compatible at line 280 of Class/MOP/Class.pm, avg 8µs/call
# 175 times (1.38ms+0s) by Class::MOP::Class::_construct_class_instance at line 86 of Class/MOP/Class.pm, avg 8µs/call
# 163 times (1.65ms+0s) by Class::MOP::Class::_class_metaclass_is_compatible at line 250 of Class/MOP/Class.pm, avg 10µs/call
# 111 times (1.00ms+0s) by Moose::Meta::Class::initialize at line 68 of Moose/Meta/Class.pm, avg 9µs/call
# 89 times (757µs+0s) by Class::MOP::Package::initialize at line 30 of Class/MOP/Package.pm, avg 9µs/call
# 82 times (695µs+0s) by Moose::Meta::Role::initialize at line 171 of Moose/Meta/Role.pm, avg 8µs/call
# 45 times (541µs+0s) by Moose::init_meta at line 167 of Moose.pm, avg 12µs/call
# 40 times (489µs+0s) by Moose::Role::init_meta at line 120 of Moose/Role.pm, avg 12µs/call | ||
| 52 | 264 | 4.23ms | # spent 3.59ms within Class::MOP::store_metaclass_by_name which was called 264 times, avg 14µs/call:
# 175 times (2.39ms+0s) by Class::MOP::Class::_construct_class_instance at line 111 of Class/MOP/Class.pm, avg 14µs/call
# 89 times (1.20ms+0s) by Class::MOP::Package::initialize at line 37 of Class/MOP/Package.pm, avg 14µs/call | ||
| 53 | 44 | 1.39ms | 44 | 459µs | # spent 1.33ms (871µs+459µs) within Class::MOP::weaken_metaclass which was called 44 times, avg 30µs/call:
# 42 times (828µs+445µs) by Moose::Meta::Role::initialize at line 183 of Moose/Meta/Role.pm, avg 30µs/call
# 2 times (43µs+14µs) by Class::MOP::Class::_construct_class_instance at line 116 of Class/MOP/Class.pm, avg 29µs/call # spent 459µs making 44 calls to Scalar::Util::weaken, avg 10µs/call |
| 54 | 505 | 13.2ms | 505 | 2.96ms | # spent 12.9ms (9.98+2.96) within Class::MOP::metaclass_is_weak which was called 505 times, avg 26µs/call:
# 390 times (7.66ms+2.30ms) by Class::MOP::Class::_construct_instance at line 581 of Class/MOP/Class.pm, avg 26µs/call
# 73 times (1.52ms+453µs) by Class::MOP::Class::_inline_preserve_weak_metaclasses at line 745 of Class/MOP/Class.pm, avg 27µs/call
# 42 times (797µs+210µs) by Class::MOP::Class::reinitialize at line 56 of Class/MOP/Class.pm, avg 24µs/call # spent 2.96ms making 505 calls to Scalar::Util::isweak, avg 6µs/call |
| 55 | sub does_metaclass_exist { exists $METAS{$_[0]} && defined $METAS{$_[0]} } | ||||
| 56 | 84 | 619µs | # spent 515µs within Class::MOP::remove_metaclass_by_name which was called 42 times, avg 12µs/call:
# 42 times (515µs+0s) by Class::MOP::Package::reinitialize at line 58 of Class/MOP/Package.pm, avg 12µs/call | ||
| 57 | |||||
| 58 | # This handles instances as well as class names | ||||
| 59 | # spent 46.0ms (38.6+7.43) within Class::MOP::class_of which was called 1438 times, avg 32µs/call:
# 427 times (10.3ms+1.84ms) by Moose::Meta::Class::excludes_role at line 240 of Moose/Meta/Class.pm, avg 28µs/call
# 167 times (5.34ms+953µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:321] at line 321 of Moose/Exporter.pm, avg 38µs/call
# 137 times (4.18ms+853µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:125] at line 96 of Moose/Exporter.pm, avg 37µs/call
# 130 times (3.06ms+586µs) by Moose::Meta::Class::does_role at line 220 of Moose/Meta/Class.pm, avg 28µs/call
# 123 times (3.52ms+736µs) by Class::MOP::Class::_superclasses_updated at line 1010 of Class/MOP/Class.pm, avg 35µs/call
# 121 times (3.46ms+696µs) by Moose::Meta::Class::superclasses at line 473 of Moose/Meta/Class.pm, avg 34µs/call
# 104 times (2.76ms+518µs) by Moose::Util::_apply_all_roles at line 114 of Moose/Util.pm, avg 31µs/call
# 42 times (1.26ms+278µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:643] at line 625 of Moose/Exporter.pm, avg 37µs/call
# 42 times (1.29ms+233µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:643] at line 636 of Moose/Exporter.pm, avg 36µs/call
# 42 times (1.02ms+189µs) by Moose::Util::MetaRole::apply_base_class_roles at line 138 of Moose/Util/MetaRole.pm, avg 29µs/call
# 42 times (977µs+213µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:643] at line 642 of Moose/Exporter.pm, avg 28µs/call
# 42 times (902µs+231µs) by Moose::Util::MetaRole::apply_metaroles at line 30 of Moose/Util/MetaRole.pm, avg 27µs/call
# 9 times (207µs+37µs) by Moose::Meta::Attribute::BEGIN@20 at line 693 of Moose/Util/TypeConstraints.pm, avg 27µs/call
# 6 times (177µs+40µs) by Moose::Object::does at line 122 of Moose/Object.pm, avg 36µs/call
# 2 times (61µs+12µs) by MooseX::Role::Parameterized::role at line 41 of MooseX/Role/Parameterized.pm, avg 37µs/call
# once (30µs+7µs) by Class::MOP::Object::_new at line 22 of Class/MOP/Object.pm
# once (29µs+5µs) by MooseX::Role::Parameterized::parameter at line 28 of MooseX/Role/Parameterized.pm | ||||
| 60 | 4314 | 50.0ms | return unless defined $_[0]; | ||
| 61 | 1438 | 7.43ms | my $class = blessed($_[0]) || $_[0]; # spent 7.43ms making 1438 calls to Scalar::Util::blessed, avg 5µs/call | ||
| 62 | return $METAS{$class}; | ||||
| 63 | } | ||||
| 64 | |||||
| 65 | # NOTE: | ||||
| 66 | # We only cache metaclasses, meaning instances of | ||||
| 67 | # Class::MOP::Class. We do not cache instance of | ||||
| 68 | # Class::MOP::Package or Class::MOP::Module. Mostly | ||||
| 69 | # because I don't yet see a good reason to do so. | ||||
| 70 | } | ||||
| 71 | |||||
| 72 | # spent 1.89ms (1.29+600µs) within Class::MOP::_class_to_pmfile which was called 45 times, avg 42µs/call:
# 45 times (1.29ms+600µs) by Class::MOP::load_first_existing_class at line 111, avg 42µs/call | ||||
| 73 | 180 | 1.96ms | my $class = shift; | ||
| 74 | |||||
| 75 | my $file = $class . '.pm'; | ||||
| 76 | 45 | 600µs | $file =~ s{::}{/}g; # spent 600µs making 45 calls to Class::MOP::CORE:subst, avg 13µs/call | ||
| 77 | |||||
| 78 | return $file; | ||||
| 79 | } | ||||
| 80 | |||||
| 81 | # spent 3.48s (54.9ms+3.42) within Class::MOP::load_first_existing_class which was called 642 times, avg 5.41ms/call:
# 632 times (53.4ms+3.42s) by Class::MOP::load_class at line 137, avg 5.49ms/call
# 10 times (1.47ms+5.38ms) by Moose::Util::resolve_metaclass_alias at line 202 of Moose/Util.pm, avg 685µs/call | ||||
| 82 | 6550 | 65.6ms | 642 | 40.3ms | my $classes = Data::OptList::mkopt(\@_) # spent 40.3ms making 642 calls to Data::OptList::mkopt, avg 63µs/call |
| 83 | or return; | ||||
| 84 | |||||
| 85 | foreach my $class (@{ $classes }) { | ||||
| 86 | my $name = $class->[0]; | ||||
| 87 | 652 | 31.9ms | unless ( _is_valid_class_name($name) ) { # spent 31.9ms making 652 calls to Class::MOP::_is_valid_class_name, avg 49µs/call | ||
| 88 | my $display = defined($name) ? $name : 'undef'; | ||||
| 89 | confess "Invalid class name ($display)"; | ||||
| 90 | } | ||||
| 91 | } | ||||
| 92 | |||||
| 93 | my $found; | ||||
| 94 | my %exceptions; | ||||
| 95 | |||||
| 96 | for my $class (@{ $classes }) { | ||||
| 97 | my ($name, $options) = @{ $class }; | ||||
| 98 | |||||
| 99 | if ($options) { | ||||
| 100 | 21 | 442µs | return $name if is_class_loaded($name, $options); # spent 442µs making 21 calls to Class::MOP::is_class_loaded, avg 21µs/call | ||
| 101 | 5 | 44µs | if (is_class_loaded($name)) { # spent 44µs making 5 calls to Class::MOP::is_class_loaded, avg 9µs/call | ||
| 102 | # we already know it's loaded and too old, but we call | ||||
| 103 | # ->VERSION anyway to generate the exception for us | ||||
| 104 | $name->VERSION($options->{-version}); | ||||
| 105 | } | ||||
| 106 | } | ||||
| 107 | else { | ||||
| 108 | 626 | 11.4ms | return $name if is_class_loaded($name); # spent 11.4ms making 626 calls to Class::MOP::is_class_loaded, avg 18µs/call | ||
| 109 | } | ||||
| 110 | |||||
| 111 | 45 | 1.89ms | my $file = _class_to_pmfile($name); # spent 1.89ms making 45 calls to Class::MOP::_class_to_pmfile, avg 42µs/call | ||
| 112 | # spent 4.01s (84.2ms+3.93) within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] which was called 45 times, avg 89.2ms/call:
# 45 times (84.2ms+3.93s) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 89.2ms/call | ||||
| 113 | 170 | 22.8ms | local $SIG{__DIE__}; | ||
| 114 | require $file; | ||||
| 115 | $name->VERSION($options->{-version}) | ||||
| 116 | if defined $options->{-version}; | ||||
| 117 | return 1; | ||||
| 118 | } | ||||
| 119 | # spent 443µs (190+253) within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:125] which was called 5 times, avg 89µs/call:
# 5 times (190µs+253µs) by Try::Tiny::try at line 100 of Try/Tiny.pm, avg 89µs/call | ||||
| 120 | 10 | 450µs | 10 | 253µs | unless (/^Can't locate \Q$file\E in \@INC/) { # spent 208µs making 5 calls to Class::MOP::CORE:regcomp, avg 42µs/call
# spent 45µs making 5 calls to Class::MOP::CORE:match, avg 9µs/call |
| 121 | confess "Couldn't load class ($name) because: $_"; | ||||
| 122 | } | ||||
| 123 | |||||
| 124 | return; | ||||
| 125 | 90 | 2.57s | }; # spent 4.02s making 45 calls to Try::Tiny::try, avg 89.3ms/call, recursion: max depth 3, sum of overlapping time 1.45s
# spent 944µs making 45 calls to Try::Tiny::catch, avg 21µs/call | ||
| 126 | } | ||||
| 127 | |||||
| 128 | if ( @{ $classes } > 1 ) { | ||||
| 129 | my @list = map { $_->[0] } @{ $classes }; | ||||
| 130 | confess "Can't locate any of @list in \@INC (\@INC contains: @INC)."; | ||||
| 131 | } else { | ||||
| 132 | confess "Can't locate " . _class_to_pmfile($classes->[0]->[0]) . " in \@INC (\@INC contains: @INC)."; | ||||
| 133 | } | ||||
| 134 | } | ||||
| 135 | |||||
| 136 | # spent 3.48s (17.9ms+3.47) within Class::MOP::load_class which was called 632 times, avg 5.51ms/call:
# 141 times (3.93ms+23.9ms) by Moose::Meta::Role::apply at line 450 of Moose/Meta/Role.pm, avg 197µs/call
# 121 times (3.30ms+21.6ms) by Moose::Meta::Class::superclasses at line 472 of Moose/Meta/Class.pm, avg 206µs/call
# 104 times (3.15ms+879ms) by Moose::Util::_apply_all_roles at line 113 of Moose/Util.pm, avg 8.48ms/call
# 73 times (2.01ms+7.65ms) by Class::MOP::Class::_inline_constructor at line 1469 of Class/MOP/Class.pm, avg 132µs/call
# 56 times (1.50ms+1.55s) by MooseX::Types::Combine::import at line 40 of MooseX/Types/Combine.pm, avg 27.6ms/call
# 43 times (1.19ms+8.68ms) by Class::MOP::Class::_inline_destructor at line 1501 of Class/MOP/Class.pm, avg 230µs/call
# 42 times (1.08ms+9.06ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::generate_role at line 83 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm, avg 241µs/call
# 28 times (967µs+800ms) by Moose::Meta::Attribute::Native::Trait::_native_accessor_class_for at line 172 of Moose/Meta/Attribute/Native/Trait.pm, avg 28.6ms/call
# 15 times (439µs+4.98ms) by Class::MOP::MiniTrait::apply at line 14 of Class/MOP/MiniTrait.pm, avg 361µs/call
# 5 times (213µs+164ms) by Moose::Meta::Attribute::Custom::Trait::Array::register_implementation or Moose::Meta::Attribute::Custom::Trait::Bool::register_implementation or Moose::Meta::Attribute::Custom::Trait::Counter::register_implementation or Moose::Meta::Attribute::Custom::Trait::Hash::register_implementation or Moose::Meta::Attribute::Custom::Trait::String::register_implementation at line 24 of Moose/Meta/Attribute/Native.pm, avg 32.8ms/call
# 3 times (80µs+-80µs) by Moose::Meta::Role::Composite::apply_params at line 122 of Moose/Meta/Role/Composite.pm, avg 0s/call
# once (27µs+-27µs) by metaclass::import at line 29 of metaclass.pm | ||||
| 137 | 1264 | 15.5ms | 632 | 3.47s | load_first_existing_class($_[0], ref $_[1] ? $_[1] : ()); # spent 4.15s making 632 calls to Class::MOP::load_first_existing_class, avg 6.57ms/call, recursion: max depth 3, sum of overlapping time 685ms |
| 138 | |||||
| 139 | # This is done to avoid breaking code which checked the return value. Said | ||||
| 140 | # code is dumb. The return value was _always_ true, since it dies on | ||||
| 141 | # failure! | ||||
| 142 | return 1; | ||||
| 143 | } | ||||
| 144 | |||||
| 145 | # spent 35.5ms (20.8+14.7) within Class::MOP::_is_valid_class_name which was called 719 times, avg 49µs/call:
# 652 times (18.8ms+13.1ms) by Class::MOP::load_first_existing_class at line 87, avg 49µs/call
# 67 times (2.02ms+1.57ms) by Class::MOP::Module::_instantiate_module at line 61 of Class/MOP/Module.pm, avg 54µs/call | ||||
| 146 | 3595 | 36.3ms | my $class = shift; | ||
| 147 | |||||
| 148 | return 0 if ref($class); | ||||
| 149 | return 0 unless defined($class); | ||||
| 150 | return 0 unless length($class); | ||||
| 151 | |||||
| 152 | 719 | 14.7ms | return 1 if $class =~ /^\w+(?:::\w+)*$/; # spent 14.7ms making 719 calls to Class::MOP::CORE:match, avg 20µs/call | ||
| 153 | |||||
| 154 | return 0; | ||||
| 155 | } | ||||
| 156 | |||||
| 157 | ## ---------------------------------------------------------------------------- | ||||
| 158 | ## Setting up our environment ... | ||||
| 159 | ## ---------------------------------------------------------------------------- | ||||
| 160 | ## Class::MOP needs to have a few things in the global perl environment so | ||||
| 161 | ## that it can operate effectively. Those things are done here. | ||||
| 162 | ## ---------------------------------------------------------------------------- | ||||
| 163 | |||||
| 164 | # ... nothing yet actually ;) | ||||
| 165 | |||||
| 166 | ## ---------------------------------------------------------------------------- | ||||
| 167 | ## Bootstrapping | ||||
| 168 | ## ---------------------------------------------------------------------------- | ||||
| 169 | ## The code below here is to bootstrap our MOP with itself. This is also | ||||
| 170 | ## sometimes called "tying the knot". By doing this, we make it much easier | ||||
| 171 | ## to extend the MOP through subclassing and such since now you can use the | ||||
| 172 | ## MOP itself to extend itself. | ||||
| 173 | ## | ||||
| 174 | ## Yes, I know, thats weird and insane, but it's a good thing, trust me :) | ||||
| 175 | ## ---------------------------------------------------------------------------- | ||||
| 176 | |||||
| 177 | # We need to add in the meta-attributes here so that | ||||
| 178 | # any subclass of Class::MOP::* will be able to | ||||
| 179 | # inherit them using _construct_instance | ||||
| 180 | |||||
| 181 | ## -------------------------------------------------------- | ||||
| 182 | ## Class::MOP::Mixin::HasMethods | ||||
| 183 | |||||
| 184 | Class::MOP::Mixin::HasMethods->meta->add_attribute( | ||||
| 185 | Class::MOP::Attribute->new('_methods' => ( | ||||
| 186 | reader => { | ||||
| 187 | # NOTE: | ||||
| 188 | # we just alias the original method | ||||
| 189 | # rather than re-produce it here | ||||
| 190 | '_method_map' => \&Class::MOP::Mixin::HasMethods::_method_map | ||||
| 191 | }, | ||||
| 192 | 193 | 2.47ms | # spent 1.89ms within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:192] which was called 193 times, avg 10µs/call:
# 155 times (1.51ms+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 10µs/call
# 38 times (383µs+0s) by Moose::Meta::Role::_new at line 12 of generated method (unknown origin), avg 10µs/call | ||
| 193 | 1 | 78µs | 3 | 5.77ms | )) # spent 2.94ms making 1 call to Class::MOP::Mixin::meta
# spent 2.61ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 217µs making 1 call to Class::MOP::Attribute::new |
| 194 | ); | ||||
| 195 | |||||
| 196 | 1 | 57µs | 3 | 1.78ms | Class::MOP::Mixin::HasMethods->meta->add_attribute( # spent 1.57ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 122µs making 1 call to Class::MOP::Attribute::new
# spent 87µs making 1 call to Class::MOP::Mixin::meta |
| 197 | Class::MOP::Attribute->new('method_metaclass' => ( | ||||
| 198 | reader => { | ||||
| 199 | # NOTE: | ||||
| 200 | # we just alias the original method | ||||
| 201 | # rather than re-produce it here | ||||
| 202 | 'method_metaclass' => \&Class::MOP::Mixin::HasMethods::method_metaclass | ||||
| 203 | }, | ||||
| 204 | default => 'Class::MOP::Method', | ||||
| 205 | )) | ||||
| 206 | ); | ||||
| 207 | |||||
| 208 | 1 | 57µs | 3 | 1.76ms | Class::MOP::Mixin::HasMethods->meta->add_attribute( # spent 1.55ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 130µs making 1 call to Class::MOP::Attribute::new
# spent 81µs making 1 call to Class::MOP::Mixin::meta |
| 209 | Class::MOP::Attribute->new('wrapped_method_metaclass' => ( | ||||
| 210 | reader => { | ||||
| 211 | # NOTE: | ||||
| 212 | # we just alias the original method | ||||
| 213 | # rather than re-produce it here | ||||
| 214 | 'wrapped_method_metaclass' => \&Class::MOP::Mixin::HasMethods::wrapped_method_metaclass | ||||
| 215 | }, | ||||
| 216 | default => 'Class::MOP::Method::Wrapped', | ||||
| 217 | )) | ||||
| 218 | ); | ||||
| 219 | |||||
| 220 | ## -------------------------------------------------------- | ||||
| 221 | ## Class::MOP::Mixin::HasMethods | ||||
| 222 | |||||
| 223 | Class::MOP::Mixin::HasAttributes->meta->add_attribute( | ||||
| 224 | Class::MOP::Attribute->new('attributes' => ( | ||||
| 225 | reader => { | ||||
| 226 | # NOTE: we need to do this in order | ||||
| 227 | # for the instance meta-object to | ||||
| 228 | # not fall into meta-circular death | ||||
| 229 | # | ||||
| 230 | # we just alias the original method | ||||
| 231 | # rather than re-produce it here | ||||
| 232 | '_attribute_map' => \&Class::MOP::Mixin::HasAttributes::_attribute_map | ||||
| 233 | }, | ||||
| 234 | 196 | 2.45ms | # spent 2.00ms within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:234] which was called 196 times, avg 10µs/call:
# 155 times (1.63ms+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 11µs/call
# 38 times (346µs+0s) by Moose::Meta::Role::_new at line 60 of generated method (unknown origin), avg 9µs/call
# 3 times (29µs+0s) by Moose::Meta::Role::Composite::_new at line 66 of generated method (unknown origin), avg 10µs/call | ||
| 235 | 1 | 69µs | 3 | 3.52ms | )) # spent 1.85ms making 1 call to Class::MOP::Mixin::meta
# spent 1.52ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 153µs making 1 call to Class::MOP::Attribute::new |
| 236 | ); | ||||
| 237 | |||||
| 238 | 1 | 53µs | 3 | 1.74ms | Class::MOP::Mixin::HasAttributes->meta->add_attribute( # spent 1.54ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 119µs making 1 call to Class::MOP::Attribute::new
# spent 81µs making 1 call to Class::MOP::Mixin::meta |
| 239 | Class::MOP::Attribute->new('attribute_metaclass' => ( | ||||
| 240 | reader => { | ||||
| 241 | # NOTE: | ||||
| 242 | # we just alias the original method | ||||
| 243 | # rather than re-produce it here | ||||
| 244 | 'attribute_metaclass' => \&Class::MOP::Mixin::HasAttributes::attribute_metaclass | ||||
| 245 | }, | ||||
| 246 | default => 'Class::MOP::Attribute', | ||||
| 247 | )) | ||||
| 248 | ); | ||||
| 249 | |||||
| 250 | ## -------------------------------------------------------- | ||||
| 251 | ## Class::MOP::Package | ||||
| 252 | |||||
| 253 | 1 | 65µs | 3 | 3.85ms | Class::MOP::Package->meta->add_attribute( # spent 2.23ms making 1 call to Class::MOP::Object::meta
# spent 1.51ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 116µs making 1 call to Class::MOP::Attribute::new |
| 254 | Class::MOP::Attribute->new('package' => ( | ||||
| 255 | reader => { | ||||
| 256 | # NOTE: we need to do this in order | ||||
| 257 | # for the instance meta-object to | ||||
| 258 | # not fall into meta-circular death | ||||
| 259 | # | ||||
| 260 | # we just alias the original method | ||||
| 261 | # rather than re-produce it here | ||||
| 262 | 'name' => \&Class::MOP::Package::name | ||||
| 263 | }, | ||||
| 264 | )) | ||||
| 265 | ); | ||||
| 266 | |||||
| 267 | Class::MOP::Package->meta->add_attribute( | ||||
| 268 | Class::MOP::Attribute->new('namespace' => ( | ||||
| 269 | reader => { | ||||
| 270 | # NOTE: | ||||
| 271 | # we just alias the original method | ||||
| 272 | # rather than re-produce it here | ||||
| 273 | 'namespace' => \&Class::MOP::Package::namespace | ||||
| 274 | }, | ||||
| 275 | init_arg => undef, | ||||
| 276 | 196 | 2.41ms | # spent 1.99ms within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:276] which was called 196 times, avg 10µs/call:
# 155 times (1.54ms+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 10µs/call
# 38 times (423µs+0s) by Moose::Meta::Role::_new at line 90 of generated method (unknown origin), avg 11µs/call
# 3 times (27µs+0s) by Moose::Meta::Role::Composite::_new at line 99 of generated method (unknown origin), avg 9µs/call | ||
| 277 | 1 | 74µs | 3 | 2.40ms | )) # spent 2.16ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 166µs making 1 call to Class::MOP::Attribute::new
# spent 83µs making 1 call to Class::MOP::Object::meta |
| 278 | ); | ||||
| 279 | |||||
| 280 | ## -------------------------------------------------------- | ||||
| 281 | ## Class::MOP::Module | ||||
| 282 | |||||
| 283 | # NOTE: | ||||
| 284 | # yeah this is kind of stretching things a bit, | ||||
| 285 | # but truthfully the version should be an attribute | ||||
| 286 | # of the Module, the weirdness comes from having to | ||||
| 287 | # stick to Perl 5 convention and store it in the | ||||
| 288 | # $VERSION package variable. Basically if you just | ||||
| 289 | # squint at it, it will look how you want it to look. | ||||
| 290 | # Either as a package variable, or as a attribute of | ||||
| 291 | # the metaclass, isn't abstraction great :) | ||||
| 292 | |||||
| 293 | Class::MOP::Module->meta->add_attribute( | ||||
| 294 | Class::MOP::Attribute->new('version' => ( | ||||
| 295 | reader => { | ||||
| 296 | # NOTE: | ||||
| 297 | # we just alias the original method | ||||
| 298 | # rather than re-produce it here | ||||
| 299 | 'version' => \&Class::MOP::Module::version | ||||
| 300 | }, | ||||
| 301 | init_arg => undef, | ||||
| 302 | 196 | 2.24ms | # spent 1.82ms within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:302] which was called 196 times, avg 9µs/call:
# 155 times (1.46ms+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 9µs/call
# 38 times (334µs+0s) by Moose::Meta::Role::_new at line 120 of generated method (unknown origin), avg 9µs/call
# 3 times (26µs+0s) by Moose::Meta::Role::Composite::_new at line 129 of generated method (unknown origin), avg 9µs/call | ||
| 303 | 1 | 81µs | 3 | 3.92ms | )) # spent 1.94ms making 1 call to Class::MOP::Object::meta
# spent 1.83ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 156µs making 1 call to Class::MOP::Attribute::new |
| 304 | ); | ||||
| 305 | |||||
| 306 | # NOTE: | ||||
| 307 | # By following the same conventions as version here, | ||||
| 308 | # we are opening up the possibility that people can | ||||
| 309 | # use the $AUTHORITY in non-Class::MOP modules as | ||||
| 310 | # well. | ||||
| 311 | |||||
| 312 | Class::MOP::Module->meta->add_attribute( | ||||
| 313 | Class::MOP::Attribute->new('authority' => ( | ||||
| 314 | reader => { | ||||
| 315 | # NOTE: | ||||
| 316 | # we just alias the original method | ||||
| 317 | # rather than re-produce it here | ||||
| 318 | 'authority' => \&Class::MOP::Module::authority | ||||
| 319 | }, | ||||
| 320 | init_arg => undef, | ||||
| 321 | 196 | 2.53ms | # spent 1.95ms within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:321] which was called 196 times, avg 10µs/call:
# 155 times (1.54ms+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 10µs/call
# 38 times (379µs+0s) by Moose::Meta::Role::_new at line 63 of generated method (unknown origin), avg 10µs/call
# 3 times (29µs+0s) by Moose::Meta::Role::Composite::_new at line 69 of generated method (unknown origin), avg 10µs/call | ||
| 322 | 1 | 103µs | 3 | 2.74ms | )) # spent 2.37ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 236µs making 1 call to Class::MOP::Attribute::new
# spent 131µs making 1 call to Class::MOP::Object::meta |
| 323 | ); | ||||
| 324 | |||||
| 325 | ## -------------------------------------------------------- | ||||
| 326 | ## Class::MOP::Class | ||||
| 327 | |||||
| 328 | Class::MOP::Class->meta->add_attribute( | ||||
| 329 | Class::MOP::Attribute->new('superclasses' => ( | ||||
| 330 | accessor => { | ||||
| 331 | # NOTE: | ||||
| 332 | # we just alias the original method | ||||
| 333 | # rather than re-produce it here | ||||
| 334 | 'superclasses' => \&Class::MOP::Class::superclasses | ||||
| 335 | }, | ||||
| 336 | init_arg => undef, | ||||
| 337 | 111 | 1.37ms | # spent 1.13ms within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:337] which was called 111 times, avg 10µs/call:
# 111 times (1.13ms+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 10µs/call | ||
| 338 | 1 | 99µs | 3 | 7.43ms | )) # spent 5.53ms making 1 call to Class::MOP::Object::meta
# spent 1.75ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 155µs making 1 call to Class::MOP::Attribute::new |
| 339 | ); | ||||
| 340 | |||||
| 341 | 1 | 45µs | 3 | 1.61ms | Class::MOP::Class->meta->add_attribute( # spent 1.37ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 124µs making 1 call to Class::MOP::Attribute::new
# spent 118µs making 1 call to Class::MOP::Object::meta |
| 342 | Class::MOP::Attribute->new('instance_metaclass' => ( | ||||
| 343 | reader => { | ||||
| 344 | # NOTE: we need to do this in order | ||||
| 345 | # for the instance meta-object to | ||||
| 346 | # not fall into meta-circular death | ||||
| 347 | # | ||||
| 348 | # we just alias the original method | ||||
| 349 | # rather than re-produce it here | ||||
| 350 | 'instance_metaclass' => \&Class::MOP::Class::instance_metaclass | ||||
| 351 | }, | ||||
| 352 | default => 'Class::MOP::Instance', | ||||
| 353 | )) | ||||
| 354 | ); | ||||
| 355 | |||||
| 356 | 1 | 43µs | 3 | 1.55ms | Class::MOP::Class->meta->add_attribute( # spent 1.35ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 115µs making 1 call to Class::MOP::Attribute::new
# spent 81µs making 1 call to Class::MOP::Object::meta |
| 357 | Class::MOP::Attribute->new('immutable_trait' => ( | ||||
| 358 | reader => { | ||||
| 359 | 'immutable_trait' => \&Class::MOP::Class::immutable_trait | ||||
| 360 | }, | ||||
| 361 | default => "Class::MOP::Class::Immutable::Trait", | ||||
| 362 | )) | ||||
| 363 | ); | ||||
| 364 | |||||
| 365 | 1 | 48µs | 3 | 1.65ms | Class::MOP::Class->meta->add_attribute( # spent 1.46ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 116µs making 1 call to Class::MOP::Attribute::new
# spent 82µs making 1 call to Class::MOP::Object::meta |
| 366 | Class::MOP::Attribute->new('constructor_name' => ( | ||||
| 367 | reader => { | ||||
| 368 | 'constructor_name' => \&Class::MOP::Class::constructor_name, | ||||
| 369 | }, | ||||
| 370 | default => "new", | ||||
| 371 | )) | ||||
| 372 | ); | ||||
| 373 | |||||
| 374 | 1 | 63µs | 3 | 1.66ms | Class::MOP::Class->meta->add_attribute( # spent 1.37ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 169µs making 1 call to Class::MOP::Attribute::new
# spent 122µs making 1 call to Class::MOP::Object::meta |
| 375 | Class::MOP::Attribute->new('constructor_class' => ( | ||||
| 376 | reader => { | ||||
| 377 | 'constructor_class' => \&Class::MOP::Class::constructor_class, | ||||
| 378 | }, | ||||
| 379 | default => "Class::MOP::Method::Constructor", | ||||
| 380 | )) | ||||
| 381 | ); | ||||
| 382 | |||||
| 383 | |||||
| 384 | 1 | 41µs | 3 | 1.61ms | Class::MOP::Class->meta->add_attribute( # spent 1.42ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 110µs making 1 call to Class::MOP::Attribute::new
# spent 84µs making 1 call to Class::MOP::Object::meta |
| 385 | Class::MOP::Attribute->new('destructor_class' => ( | ||||
| 386 | reader => { | ||||
| 387 | 'destructor_class' => \&Class::MOP::Class::destructor_class, | ||||
| 388 | }, | ||||
| 389 | )) | ||||
| 390 | ); | ||||
| 391 | |||||
| 392 | # NOTE: | ||||
| 393 | # we don't actually need to tie the knot with | ||||
| 394 | # Class::MOP::Class here, it is actually handled | ||||
| 395 | # within Class::MOP::Class itself in the | ||||
| 396 | # _construct_class_instance method. | ||||
| 397 | |||||
| 398 | ## -------------------------------------------------------- | ||||
| 399 | ## Class::MOP::Mixin::AttributeCore | ||||
| 400 | 1 | 53µs | 3 | 3.45ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 1.77ms making 1 call to Class::MOP::Mixin::meta
# spent 1.56ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 130µs making 1 call to Class::MOP::Attribute::new |
| 401 | Class::MOP::Attribute->new('name' => ( | ||||
| 402 | reader => { | ||||
| 403 | # NOTE: we need to do this in order | ||||
| 404 | # for the instance meta-object to | ||||
| 405 | # not fall into meta-circular death | ||||
| 406 | # | ||||
| 407 | # we just alias the original method | ||||
| 408 | # rather than re-produce it here | ||||
| 409 | 'name' => \&Class::MOP::Mixin::AttributeCore::name | ||||
| 410 | } | ||||
| 411 | )) | ||||
| 412 | ); | ||||
| 413 | |||||
| 414 | 1 | 45µs | 3 | 2.36ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 2.14ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 138µs making 1 call to Class::MOP::Attribute::new
# spent 82µs making 1 call to Class::MOP::Mixin::meta |
| 415 | Class::MOP::Attribute->new('accessor' => ( | ||||
| 416 | reader => { 'accessor' => \&Class::MOP::Mixin::AttributeCore::accessor }, | ||||
| 417 | predicate => { 'has_accessor' => \&Class::MOP::Mixin::AttributeCore::has_accessor }, | ||||
| 418 | )) | ||||
| 419 | ); | ||||
| 420 | |||||
| 421 | 1 | 47µs | 3 | 2.31ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 2.08ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 141µs making 1 call to Class::MOP::Attribute::new
# spent 82µs making 1 call to Class::MOP::Mixin::meta |
| 422 | Class::MOP::Attribute->new('reader' => ( | ||||
| 423 | reader => { 'reader' => \&Class::MOP::Mixin::AttributeCore::reader }, | ||||
| 424 | predicate => { 'has_reader' => \&Class::MOP::Mixin::AttributeCore::has_reader }, | ||||
| 425 | )) | ||||
| 426 | ); | ||||
| 427 | |||||
| 428 | 1 | 47µs | 3 | 2.31ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 2.09ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 138µs making 1 call to Class::MOP::Attribute::new
# spent 81µs making 1 call to Class::MOP::Mixin::meta |
| 429 | Class::MOP::Attribute->new('initializer' => ( | ||||
| 430 | reader => { 'initializer' => \&Class::MOP::Mixin::AttributeCore::initializer }, | ||||
| 431 | predicate => { 'has_initializer' => \&Class::MOP::Mixin::AttributeCore::has_initializer }, | ||||
| 432 | )) | ||||
| 433 | ); | ||||
| 434 | |||||
| 435 | 1 | 42µs | 3 | 1.70ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 1.48ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 136µs making 1 call to Class::MOP::Attribute::new
# spent 81µs making 1 call to Class::MOP::Mixin::meta |
| 436 | Class::MOP::Attribute->new('definition_context' => ( | ||||
| 437 | reader => { 'definition_context' => \&Class::MOP::Mixin::AttributeCore::definition_context }, | ||||
| 438 | )) | ||||
| 439 | ); | ||||
| 440 | |||||
| 441 | 1 | 47µs | 3 | 2.40ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 2.17ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 141µs making 1 call to Class::MOP::Attribute::new
# spent 82µs making 1 call to Class::MOP::Mixin::meta |
| 442 | Class::MOP::Attribute->new('writer' => ( | ||||
| 443 | reader => { 'writer' => \&Class::MOP::Mixin::AttributeCore::writer }, | ||||
| 444 | predicate => { 'has_writer' => \&Class::MOP::Mixin::AttributeCore::has_writer }, | ||||
| 445 | )) | ||||
| 446 | ); | ||||
| 447 | |||||
| 448 | 1 | 49µs | 3 | 2.29ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 2.06ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 144µs making 1 call to Class::MOP::Attribute::new
# spent 86µs making 1 call to Class::MOP::Mixin::meta |
| 449 | Class::MOP::Attribute->new('predicate' => ( | ||||
| 450 | reader => { 'predicate' => \&Class::MOP::Mixin::AttributeCore::predicate }, | ||||
| 451 | predicate => { 'has_predicate' => \&Class::MOP::Mixin::AttributeCore::has_predicate }, | ||||
| 452 | )) | ||||
| 453 | ); | ||||
| 454 | |||||
| 455 | 1 | 48µs | 3 | 2.34ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 2.12ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 145µs making 1 call to Class::MOP::Attribute::new
# spent 80µs making 1 call to Class::MOP::Mixin::meta |
| 456 | Class::MOP::Attribute->new('clearer' => ( | ||||
| 457 | reader => { 'clearer' => \&Class::MOP::Mixin::AttributeCore::clearer }, | ||||
| 458 | predicate => { 'has_clearer' => \&Class::MOP::Mixin::AttributeCore::has_clearer }, | ||||
| 459 | )) | ||||
| 460 | ); | ||||
| 461 | |||||
| 462 | 1 | 69µs | 3 | 3.68ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 3.39ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 203µs making 1 call to Class::MOP::Attribute::new
# spent 88µs making 1 call to Class::MOP::Mixin::meta |
| 463 | Class::MOP::Attribute->new('builder' => ( | ||||
| 464 | reader => { 'builder' => \&Class::MOP::Mixin::AttributeCore::builder }, | ||||
| 465 | predicate => { 'has_builder' => \&Class::MOP::Mixin::AttributeCore::has_builder }, | ||||
| 466 | )) | ||||
| 467 | ); | ||||
| 468 | |||||
| 469 | 1 | 73µs | 3 | 3.31ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 2.95ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 232µs making 1 call to Class::MOP::Attribute::new
# spent 132µs making 1 call to Class::MOP::Mixin::meta |
| 470 | Class::MOP::Attribute->new('init_arg' => ( | ||||
| 471 | reader => { 'init_arg' => \&Class::MOP::Mixin::AttributeCore::init_arg }, | ||||
| 472 | predicate => { 'has_init_arg' => \&Class::MOP::Mixin::AttributeCore::has_init_arg }, | ||||
| 473 | )) | ||||
| 474 | ); | ||||
| 475 | |||||
| 476 | 1 | 45µs | 3 | 1.70ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 1.47ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 143µs making 1 call to Class::MOP::Attribute::new
# spent 84µs making 1 call to Class::MOP::Mixin::meta |
| 477 | Class::MOP::Attribute->new('default' => ( | ||||
| 478 | # default has a custom 'reader' method ... | ||||
| 479 | predicate => { 'has_default' => \&Class::MOP::Mixin::AttributeCore::has_default }, | ||||
| 480 | )) | ||||
| 481 | ); | ||||
| 482 | |||||
| 483 | 1 | 50µs | 3 | 2.96ms | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 2.73ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 143µs making 1 call to Class::MOP::Attribute::new
# spent 83µs making 1 call to Class::MOP::Mixin::meta |
| 484 | Class::MOP::Attribute->new('insertion_order' => ( | ||||
| 485 | reader => { 'insertion_order' => \&Class::MOP::Mixin::AttributeCore::insertion_order }, | ||||
| 486 | writer => { '_set_insertion_order' => \&Class::MOP::Mixin::AttributeCore::_set_insertion_order }, | ||||
| 487 | predicate => { 'has_insertion_order' => \&Class::MOP::Mixin::AttributeCore::has_insertion_order }, | ||||
| 488 | )) | ||||
| 489 | ); | ||||
| 490 | |||||
| 491 | ## -------------------------------------------------------- | ||||
| 492 | ## Class::MOP::Attribute | ||||
| 493 | 1 | 52µs | 3 | 4.57ms | Class::MOP::Attribute->meta->add_attribute( # spent 2.88ms making 1 call to Class::MOP::Object::meta
# spent 1.54ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 145µs making 1 call to Class::MOP::Attribute::new |
| 494 | Class::MOP::Attribute->new('associated_class' => ( | ||||
| 495 | reader => { | ||||
| 496 | # NOTE: we need to do this in order | ||||
| 497 | # for the instance meta-object to | ||||
| 498 | # not fall into meta-circular death | ||||
| 499 | # | ||||
| 500 | # we just alias the original method | ||||
| 501 | # rather than re-produce it here | ||||
| 502 | 'associated_class' => \&Class::MOP::Attribute::associated_class | ||||
| 503 | } | ||||
| 504 | )) | ||||
| 505 | ); | ||||
| 506 | |||||
| 507 | Class::MOP::Attribute->meta->add_attribute( | ||||
| 508 | Class::MOP::Attribute->new('associated_methods' => ( | ||||
| 509 | reader => { 'associated_methods' => \&Class::MOP::Attribute::associated_methods }, | ||||
| 510 | 72 | 1.11ms | # spent 823µs within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:510] which was called 72 times, avg 11µs/call:
# 55 times (637µs+0s) by Moose::Meta::Attribute::_new at line 18 of generated method (unknown origin), avg 12µs/call
# 16 times (174µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 11µs/call
# once (12µs+0s) by MooseX::Role::Parameterized::Meta::Parameter::_new at line 41 of generated method (unknown origin) | ||
| 511 | 1 | 52µs | 3 | 1.68ms | )) # spent 1.38ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 182µs making 1 call to Class::MOP::Attribute::new
# spent 110µs making 1 call to Class::MOP::Object::meta |
| 512 | ); | ||||
| 513 | |||||
| 514 | Class::MOP::Attribute->meta->add_method('clone' => sub { | ||||
| 515 | 2 | 51µs | my $self = shift; | ||
| 516 | 2 | 1.28ms | $self->meta->clone_object($self, @_); # spent 1.20ms making 1 call to Class::MOP::Class::clone_object
# spent 78µs making 1 call to Class::MOP::Object::meta | ||
| 517 | 1 | 30µs | 2 | 402µs | }); # spent 320µs making 1 call to Class::MOP::Mixin::HasMethods::add_method
# spent 82µs making 1 call to Class::MOP::Object::meta |
| 518 | |||||
| 519 | ## -------------------------------------------------------- | ||||
| 520 | ## Class::MOP::Method | ||||
| 521 | 1 | 49µs | 3 | 3.42ms | Class::MOP::Method->meta->add_attribute( # spent 1.80ms making 1 call to Class::MOP::Object::meta
# spent 1.49ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 132µs making 1 call to Class::MOP::Attribute::new |
| 522 | Class::MOP::Attribute->new('body' => ( | ||||
| 523 | reader => { 'body' => \&Class::MOP::Method::body }, | ||||
| 524 | )) | ||||
| 525 | ); | ||||
| 526 | |||||
| 527 | 1 | 44µs | 3 | 2.02ms | Class::MOP::Method->meta->add_attribute( # spent 1.82ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 115µs making 1 call to Class::MOP::Attribute::new
# spent 85µs making 1 call to Class::MOP::Object::meta |
| 528 | Class::MOP::Attribute->new('associated_metaclass' => ( | ||||
| 529 | reader => { 'associated_metaclass' => \&Class::MOP::Method::associated_metaclass }, | ||||
| 530 | )) | ||||
| 531 | ); | ||||
| 532 | |||||
| 533 | 1 | 43µs | 3 | 2.00ms | Class::MOP::Method->meta->add_attribute( # spent 1.81ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 112µs making 1 call to Class::MOP::Attribute::new
# spent 82µs making 1 call to Class::MOP::Object::meta |
| 534 | Class::MOP::Attribute->new('package_name' => ( | ||||
| 535 | reader => { 'package_name' => \&Class::MOP::Method::package_name }, | ||||
| 536 | )) | ||||
| 537 | ); | ||||
| 538 | |||||
| 539 | 1 | 42µs | 3 | 2.02ms | Class::MOP::Method->meta->add_attribute( # spent 1.83ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 110µs making 1 call to Class::MOP::Attribute::new
# spent 83µs making 1 call to Class::MOP::Object::meta |
| 540 | Class::MOP::Attribute->new('name' => ( | ||||
| 541 | reader => { 'name' => \&Class::MOP::Method::name }, | ||||
| 542 | )) | ||||
| 543 | ); | ||||
| 544 | |||||
| 545 | 1 | 48µs | 3 | 3.08ms | Class::MOP::Method->meta->add_attribute( # spent 2.86ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 135µs making 1 call to Class::MOP::Attribute::new
# spent 83µs making 1 call to Class::MOP::Object::meta |
| 546 | Class::MOP::Attribute->new('original_method' => ( | ||||
| 547 | reader => { 'original_method' => \&Class::MOP::Method::original_method }, | ||||
| 548 | writer => { '_set_original_method' => \&Class::MOP::Method::_set_original_method }, | ||||
| 549 | )) | ||||
| 550 | ); | ||||
| 551 | |||||
| 552 | ## -------------------------------------------------------- | ||||
| 553 | ## Class::MOP::Method::Wrapped | ||||
| 554 | |||||
| 555 | # NOTE: | ||||
| 556 | # the way this item is initialized, this | ||||
| 557 | # really does not follow the standard | ||||
| 558 | # practices of attributes, but we put | ||||
| 559 | # it here for completeness | ||||
| 560 | 1 | 48µs | 3 | 2.65ms | Class::MOP::Method::Wrapped->meta->add_attribute( # spent 1.84ms making 1 call to Class::MOP::Object::meta
# spent 699µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 117µs making 1 call to Class::MOP::Attribute::new |
| 561 | Class::MOP::Attribute->new('modifier_table') | ||||
| 562 | ); | ||||
| 563 | |||||
| 564 | ## -------------------------------------------------------- | ||||
| 565 | ## Class::MOP::Method::Generated | ||||
| 566 | |||||
| 567 | 1 | 58µs | 3 | 3.69ms | Class::MOP::Method::Generated->meta->add_attribute( # spent 1.80ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 1.77ms making 1 call to Class::MOP::Object::meta
# spent 118µs making 1 call to Class::MOP::Attribute::new |
| 568 | Class::MOP::Attribute->new('is_inline' => ( | ||||
| 569 | reader => { 'is_inline' => \&Class::MOP::Method::Generated::is_inline }, | ||||
| 570 | default => 0, | ||||
| 571 | )) | ||||
| 572 | ); | ||||
| 573 | |||||
| 574 | 1 | 46µs | 3 | 2.03ms | Class::MOP::Method::Generated->meta->add_attribute( # spent 1.82ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 119µs making 1 call to Class::MOP::Attribute::new
# spent 87µs making 1 call to Class::MOP::Object::meta |
| 575 | Class::MOP::Attribute->new('definition_context' => ( | ||||
| 576 | reader => { 'definition_context' => \&Class::MOP::Method::Generated::definition_context }, | ||||
| 577 | )) | ||||
| 578 | ); | ||||
| 579 | |||||
| 580 | |||||
| 581 | ## -------------------------------------------------------- | ||||
| 582 | ## Class::MOP::Method::Inlined | ||||
| 583 | |||||
| 584 | 1 | 56µs | 3 | 3.81ms | Class::MOP::Method::Inlined->meta->add_attribute( # spent 1.86ms making 1 call to Class::MOP::Object::meta
# spent 1.82ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 138µs making 1 call to Class::MOP::Attribute::new |
| 585 | Class::MOP::Attribute->new('_expected_method_class' => ( | ||||
| 586 | reader => { '_expected_method_class' => \&Class::MOP::Method::Inlined::_expected_method_class }, | ||||
| 587 | )) | ||||
| 588 | ); | ||||
| 589 | |||||
| 590 | ## -------------------------------------------------------- | ||||
| 591 | ## Class::MOP::Method::Accessor | ||||
| 592 | |||||
| 593 | 1 | 57µs | 3 | 3.37ms | Class::MOP::Method::Accessor->meta->add_attribute( # spent 1.81ms making 1 call to Class::MOP::Object::meta
# spent 1.45ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 113µs making 1 call to Class::MOP::Attribute::new |
| 594 | Class::MOP::Attribute->new('attribute' => ( | ||||
| 595 | reader => { | ||||
| 596 | 'associated_attribute' => \&Class::MOP::Method::Accessor::associated_attribute | ||||
| 597 | }, | ||||
| 598 | )) | ||||
| 599 | ); | ||||
| 600 | |||||
| 601 | 1 | 43µs | 3 | 1.92ms | Class::MOP::Method::Accessor->meta->add_attribute( # spent 1.73ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 114µs making 1 call to Class::MOP::Attribute::new
# spent 84µs making 1 call to Class::MOP::Object::meta |
| 602 | Class::MOP::Attribute->new('accessor_type' => ( | ||||
| 603 | reader => { 'accessor_type' => \&Class::MOP::Method::Accessor::accessor_type }, | ||||
| 604 | )) | ||||
| 605 | ); | ||||
| 606 | |||||
| 607 | ## -------------------------------------------------------- | ||||
| 608 | ## Class::MOP::Method::Constructor | ||||
| 609 | |||||
| 610 | Class::MOP::Method::Constructor->meta->add_attribute( | ||||
| 611 | Class::MOP::Attribute->new('options' => ( | ||||
| 612 | reader => { | ||||
| 613 | 'options' => \&Class::MOP::Method::Constructor::options | ||||
| 614 | }, | ||||
| 615 | default => sub { +{} } | ||||
| 616 | 1 | 68µs | 3 | 3.78ms | )) # spent 1.83ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 1.80ms making 1 call to Class::MOP::Object::meta
# spent 154µs making 1 call to Class::MOP::Attribute::new |
| 617 | ); | ||||
| 618 | |||||
| 619 | 1 | 47µs | 3 | 1.87ms | Class::MOP::Method::Constructor->meta->add_attribute( # spent 1.68ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 114µs making 1 call to Class::MOP::Attribute::new
# spent 83µs making 1 call to Class::MOP::Object::meta |
| 620 | Class::MOP::Attribute->new('associated_metaclass' => ( | ||||
| 621 | init_arg => "metaclass", # FIXME alias and rename | ||||
| 622 | reader => { | ||||
| 623 | 'associated_metaclass' => \&Class::MOP::Method::Constructor::associated_metaclass | ||||
| 624 | }, | ||||
| 625 | )) | ||||
| 626 | ); | ||||
| 627 | |||||
| 628 | ## -------------------------------------------------------- | ||||
| 629 | ## Class::MOP::Instance | ||||
| 630 | |||||
| 631 | # NOTE: | ||||
| 632 | # these don't yet do much of anything, but are just | ||||
| 633 | # included for completeness | ||||
| 634 | |||||
| 635 | 1 | 85µs | 3 | 5.36ms | Class::MOP::Instance->meta->add_attribute( # spent 2.83ms making 1 call to Class::MOP::Object::meta
# spent 2.34ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 180µs making 1 call to Class::MOP::Attribute::new |
| 636 | Class::MOP::Attribute->new('associated_metaclass', | ||||
| 637 | reader => { associated_metaclass => \&Class::MOP::Instance::associated_metaclass }, | ||||
| 638 | ), | ||||
| 639 | ); | ||||
| 640 | |||||
| 641 | 1 | 50µs | 3 | 1.60ms | Class::MOP::Instance->meta->add_attribute( # spent 1.38ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 119µs making 1 call to Class::MOP::Attribute::new
# spent 96µs making 1 call to Class::MOP::Object::meta |
| 642 | Class::MOP::Attribute->new('_class_name', | ||||
| 643 | init_arg => undef, | ||||
| 644 | reader => { _class_name => \&Class::MOP::Instance::_class_name }, | ||||
| 645 | #lazy => 1, # not yet supported by Class::MOP but out our version does it anyway | ||||
| 646 | #default => sub { $_[0]->associated_metaclass->name }, | ||||
| 647 | ), | ||||
| 648 | ); | ||||
| 649 | |||||
| 650 | 1 | 42µs | 3 | 1.55ms | Class::MOP::Instance->meta->add_attribute( # spent 1.35ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 114µs making 1 call to Class::MOP::Attribute::new
# spent 83µs making 1 call to Class::MOP::Object::meta |
| 651 | Class::MOP::Attribute->new('attributes', | ||||
| 652 | reader => { attributes => \&Class::MOP::Instance::get_all_attributes }, | ||||
| 653 | ), | ||||
| 654 | ); | ||||
| 655 | |||||
| 656 | 1 | 59µs | 3 | 1.80ms | Class::MOP::Instance->meta->add_attribute( # spent 1.61ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 112µs making 1 call to Class::MOP::Attribute::new
# spent 81µs making 1 call to Class::MOP::Object::meta |
| 657 | Class::MOP::Attribute->new('slots', | ||||
| 658 | reader => { slots => \&Class::MOP::Instance::slots }, | ||||
| 659 | ), | ||||
| 660 | ); | ||||
| 661 | |||||
| 662 | 1 | 60µs | 3 | 1.81ms | Class::MOP::Instance->meta->add_attribute( # spent 1.61ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 116µs making 1 call to Class::MOP::Attribute::new
# spent 86µs making 1 call to Class::MOP::Object::meta |
| 663 | Class::MOP::Attribute->new('slot_hash', | ||||
| 664 | reader => { slot_hash => \&Class::MOP::Instance::slot_hash }, | ||||
| 665 | ), | ||||
| 666 | ); | ||||
| 667 | |||||
| 668 | ## -------------------------------------------------------- | ||||
| 669 | ## Class::MOP::Object | ||||
| 670 | |||||
| 671 | # need to replace the meta method there with a real meta method object | ||||
| 672 | 1 | 54µs | 2 | 6.45ms | Class::MOP::Object->meta->_add_meta_method('meta'); # spent 6.36ms making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method
# spent 86µs making 1 call to Class::MOP::Object::meta |
| 673 | |||||
| 674 | ## -------------------------------------------------------- | ||||
| 675 | ## Class::MOP::Mixin | ||||
| 676 | |||||
| 677 | # need to replace the meta method there with a real meta method object | ||||
| 678 | 1 | 42µs | 2 | 3.14ms | Class::MOP::Mixin->meta->_add_meta_method('meta'); # spent 3.06ms making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method
# spent 82µs making 1 call to Class::MOP::Mixin::meta |
| 679 | |||||
| 680 | 1 | 354µs | require Class::MOP::Deprecated unless our $no_deprecated; | ||
| 681 | |||||
| 682 | # we need the meta instance of the meta instance to be created now, in order | ||||
| 683 | # for the constructor to be able to use it | ||||
| 684 | 1 | 38µs | 2 | 844µs | Class::MOP::Instance->meta->get_meta_instance; # spent 738µs making 1 call to Class::MOP::Class::get_meta_instance
# spent 107µs making 1 call to Class::MOP::Object::meta |
| 685 | |||||
| 686 | # pretend the add_method never happenned. it hasn't yet affected anything | ||||
| 687 | 1 | 15µs | 1 | 87µs | undef Class::MOP::Instance->meta->{_package_cache_flag}; # spent 87µs making 1 call to Class::MOP::Object::meta |
| 688 | |||||
| 689 | ## -------------------------------------------------------- | ||||
| 690 | ## Now close all the Class::MOP::* classes | ||||
| 691 | |||||
| 692 | # NOTE: we don't need to inline the the accessors this only lengthens | ||||
| 693 | # the compile time of the MOP, and gives us no actual benefits. | ||||
| 694 | |||||
| 695 | $_->meta->make_immutable( | ||||
| 696 | inline_constructor => 0, | ||||
| 697 | constructor_name => "_new", | ||||
| 698 | inline_accessors => 0, | ||||
| 699 | 1 | 452µs | 26 | 87.7ms | ) for qw/ # spent 86.8ms making 13 calls to Class::MOP::Class::make_immutable, avg 6.68ms/call
# spent 923µs making 13 calls to Class::MOP::Object::meta, avg 71µs/call |
| 700 | Class::MOP::Package | ||||
| 701 | Class::MOP::Module | ||||
| 702 | Class::MOP::Class | ||||
| 703 | |||||
| 704 | Class::MOP::Attribute | ||||
| 705 | Class::MOP::Method | ||||
| 706 | Class::MOP::Instance | ||||
| 707 | |||||
| 708 | Class::MOP::Object | ||||
| 709 | |||||
| 710 | Class::MOP::Method::Generated | ||||
| 711 | Class::MOP::Method::Inlined | ||||
| 712 | |||||
| 713 | Class::MOP::Method::Accessor | ||||
| 714 | Class::MOP::Method::Constructor | ||||
| 715 | Class::MOP::Method::Wrapped | ||||
| 716 | |||||
| 717 | Class::MOP::Method::Meta | ||||
| 718 | 1 | 2µs | /; | ||
| 719 | |||||
| 720 | $_->meta->make_immutable( | ||||
| 721 | inline_constructor => 0, | ||||
| 722 | constructor_name => undef, | ||||
| 723 | inline_accessors => 0, | ||||
| 724 | 1 | 133µs | 8 | 2.88ms | ) for qw/ # spent 2.57ms making 4 calls to Class::MOP::Class::make_immutable, avg 643µs/call
# spent 304µs making 4 calls to Class::MOP::Mixin::meta, avg 76µs/call |
| 725 | Class::MOP::Mixin | ||||
| 726 | Class::MOP::Mixin::AttributeCore | ||||
| 727 | Class::MOP::Mixin::HasAttributes | ||||
| 728 | Class::MOP::Mixin::HasMethods | ||||
| 729 | 1 | 2µs | /; | ||
| 730 | |||||
| 731 | 1 | 463µs | 1; | ||
| 732 | |||||
| 733 | __END__ | ||||
# spent 14.7ms within Class::MOP::CORE:match which was called 724 times, avg 20µs/call:
# 719 times (14.7ms+0s) by Class::MOP::_is_valid_class_name at line 152, avg 20µs/call
# 5 times (45µs+0s) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:125] at line 120, avg 9µs/call | |||||
# spent 208µs within Class::MOP::CORE:regcomp which was called 5 times, avg 42µs/call:
# 5 times (208µs+0s) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:125] at line 120, avg 42µs/call | |||||
# spent 600µs within Class::MOP::CORE:subst which was called 45 times, avg 13µs/call:
# 45 times (600µs+0s) by Class::MOP::_class_to_pmfile at line 76, avg 13µs/call | |||||
# spent 1.53ms within Class::MOP::__ANON__ which was called 294 times, avg 5µs/call:
# 294 times (1.53ms+0s) by Class::MOP::Class::class_precedence_list at line 1046 of Class/MOP/Class.pm, avg 5µs/call | |||||
# spent 581µs within Class::MOP::bootstrap which was called:
# once (581µs+0s) by DynaLoader::bootstrap at line 223 of DynaLoader.pm | |||||
# spent 31.2ms within Class::MOP::get_code_info which was called 4012 times, avg 8µs/call:
# 2175 times (18.7ms+0s) by Class::MOP::Mixin::HasMethods::add_method at line 76 of Class/MOP/Mixin/HasMethods.pm, avg 9µs/call
# 1797 times (12.1ms+0s) by Class::MOP::Mixin::HasMethods::_code_is_mine at line 90 of Class/MOP/Mixin/HasMethods.pm, avg 7µs/call
# 36 times (334µs+0s) by Moose::Meta::Role::Application::ToClass::apply_override_method_modifiers at line 206 of Moose/Meta/Role/Application/ToClass.pm, avg 9µs/call
# 4 times (47µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 243 of Moose/Exporter.pm, avg 12µs/call | |||||
# spent 13.6ms within Class::MOP::is_class_loaded which was called 748 times, avg 18µs/call:
# 626 times (11.4ms+0s) by Class::MOP::load_first_existing_class at line 108, avg 18µs/call
# 94 times (1.68ms+0s) by Class::MOP::Class::_immutable_metaclass at line 1378 of Class/MOP/Class.pm, avg 18µs/call
# 21 times (442µs+0s) by Class::MOP::load_first_existing_class at line 100, avg 21µs/call
# 5 times (44µs+0s) by Class::MOP::load_first_existing_class at line 101, avg 9µs/call
# 2 times (35µs+0s) by Moose::Util::TypeConstraints::OptimizedConstraints::ClassName at line 55 of Moose/Util/TypeConstraints/OptimizedConstraints.pm, avg 18µs/call |