← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:42:38 2010
Reported on Wed Nov 17 22:04:42 2010

Filename/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm
StatementsExecuted 10691 statements in 164ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
341159.1ms1.79sClass::MOP::::__ANON__[:118]Class::MOP::__ANON__[:118]
37029635.6ms35.6msClass::MOP::::get_metaclass_by_nameClass::MOP::get_metaclass_by_name
11124.4ms109msClass::MOP::::BEGIN@19Class::MOP::BEGIN@19
2382221.7ms1.34sClass::MOP::::load_first_existing_classClass::MOP::load_first_existing_class (recurses: max depth 3, inclusive time 509ms)
51911914.8ms17.7msClass::MOP::::class_ofClass::MOP::class_of
13384311.5ms11.5msClass::MOP::::get_code_infoClass::MOP::get_code_info (xsub)
1118.56ms9.87msClass::MOP::::BEGIN@20Class::MOP::BEGIN@20
254227.51ms12.7msClass::MOP::::_is_valid_class_nameClass::MOP::_is_valid_class_name
2321096.90ms1.35sClass::MOP::::load_classClass::MOP::load_class (recurses: max depth 3, inclusive time 511ms)
321425.84ms5.84msClass::MOP::::is_class_loadedClass::MOP::is_class_loaded (xsub)
257215.26ms5.26msClass::MOP::::CORE:matchClass::MOP::CORE:match (opcode)
1114.83ms7.51msClass::MOP::::BEGIN@9Class::MOP::BEGIN@9
1114.06ms22.3msClass::MOP::::BEGIN@18Class::MOP::BEGIN@18
193213.78ms4.98msClass::MOP::::metaclass_is_weakClass::MOP::metaclass_is_weak
1112.48ms3.00msClass::MOP::::BEGIN@13Class::MOP::BEGIN@13
1112.45ms3.49msClass::MOP::::BEGIN@14Class::MOP::BEGIN@14
1112.28ms3.13msClass::MOP::::BEGIN@17Class::MOP::BEGIN@17
1112.12ms8.11msClass::MOP::::BEGIN@16Class::MOP::BEGIN@16
136221.85ms1.85msClass::MOP::::store_metaclass_by_nameClass::MOP::store_metaclass_by_name
122221.42ms1.42msClass::MOP::::__ANON__[:510]Class::MOP::__ANON__[:510]
34111.03ms1.47msClass::MOP::::_class_to_pmfileClass::MOP::_class_to_pmfile
6922714µs714µsClass::MOP::::__ANON__[:192]Class::MOP::__ANON__[:192]
7232686µs686µsClass::MOP::::__ANON__[:234]Class::MOP::__ANON__[:234]
7232676µs676µsClass::MOP::::__ANON__[:321]Class::MOP::__ANON__[:321]
7232652µs652µsClass::MOP::::__ANON__[:276]Class::MOP::__ANON__[:276]
7232635µs635µsClass::MOP::::__ANON__[:302]Class::MOP::__ANON__[:302]
111589µs589µsClass::MOP::::bootstrapClass::MOP::bootstrap (xsub)
3411443µs443µsClass::MOP::::CORE:substClass::MOP::CORE:subst (opcode)
3411389µs389µsClass::MOP::::__ANON__[:337]Class::MOP::__ANON__[:337]
5111242µs242µsClass::MOP::::__ANON__Class::MOP::__ANON__ (xsub)
311122µs122µsClass::MOP::::CORE:regcompClass::MOP::CORE:regcomp (opcode)
311112µs261µsClass::MOP::::__ANON__[:125]Class::MOP::__ANON__[:125]
11171µs71µsClass::MOP::::BEGIN@7Class::MOP::BEGIN@7
11164µs82µsClass::MOP::::BEGIN@4Class::MOP::BEGIN@4
11140µs236µsClass::MOP::::BEGIN@12Class::MOP::BEGIN@12
11139µs198µsClass::MOP::::BEGIN@11Class::MOP::BEGIN@11
11135µs100µsClass::MOP::::BEGIN@5Class::MOP::BEGIN@5
11134µs34µsClass::MOP::::BEGIN@21Class::MOP::BEGIN@21
11129µs29µsClass::MOP::::BEGIN@23Class::MOP::BEGIN@23
0000s0sClass::MOP::::__ANON__[:517]Class::MOP::__ANON__[:517]
0000s0sClass::MOP::::__ANON__[:615]Class::MOP::__ANON__[:615]
0000s0sClass::MOP::::does_metaclass_existClass::MOP::does_metaclass_exist
0000s0sClass::MOP::::get_all_metaclass_instancesClass::MOP::get_all_metaclass_instances
0000s0sClass::MOP::::get_all_metaclass_namesClass::MOP::get_all_metaclass_names
0000s0sClass::MOP::::get_all_metaclassesClass::MOP::get_all_metaclasses
0000s0sClass::MOP::::remove_metaclass_by_nameClass::MOP::remove_metaclass_by_name
0000s0sClass::MOP::::weaken_metaclassClass::MOP::weaken_metaclass
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2package Class::MOP;
3
4393µs299µs
# spent 82µs (64+17) within Class::MOP::BEGIN@4 which was called: # once (64µs+17µs) by Moose::Exporter::BEGIN@11 at line 4
use strict;
# spent 82µs making 1 call to Class::MOP::BEGIN@4 # spent 17µs making 1 call to strict::import
53121µs2165µs
# spent 100µs (35+65) within Class::MOP::BEGIN@5 which was called: # once (35µs+65µs) by Moose::Exporter::BEGIN@11 at line 5
use warnings;
# spent 100µs making 1 call to Class::MOP::BEGIN@5 # spent 65µs making 1 call to warnings::import
6
73148µs171µs
# spent 71µs within Class::MOP::BEGIN@7 which was called: # once (71µs+0s) by Moose::Exporter::BEGIN@11 at line 7
use 5.008;
# spent 71µs making 1 call to Class::MOP::BEGIN@7
8
93561µs17.51ms
# spent 7.51ms (4.83+2.68) within Class::MOP::BEGIN@9 which was called: # once (4.83ms+2.68ms) by Moose::Exporter::BEGIN@11 at line 9
use MRO::Compat;
# spent 7.51ms making 1 call to Class::MOP::BEGIN@9
10
113111µs2357µs
# spent 198µs (39+159) within Class::MOP::BEGIN@11 which was called: # once (39µs+159µs) by Moose::Exporter::BEGIN@11 at line 11
use Carp 'confess';
# spent 198µs making 1 call to Class::MOP::BEGIN@11 # spent 159µs making 1 call to Exporter::import
123140µs2433µs
# spent 236µs (40+197) within Class::MOP::BEGIN@12 which was called: # once (40µs+197µs) by Moose::Exporter::BEGIN@11 at line 12
use Scalar::Util 'weaken', 'isweak', 'reftype', 'blessed';
# spent 236µs making 1 call to Class::MOP::BEGIN@12 # spent 197µs making 1 call to Exporter::import
133647µs23.02ms
# spent 3.00ms (2.48+520µs) within Class::MOP::BEGIN@13 which was called: # once (2.48ms+520µs) by Moose::Exporter::BEGIN@11 at line 13
use Data::OptList;
# spent 3.00ms making 1 call to Class::MOP::BEGIN@13 # spent 23µs making 1 call to Sub::Install::__ANON__[Sub/Install.pm:284]
143603µs23.72ms
# spent 3.49ms (2.45+1.04) within Class::MOP::BEGIN@14 which was called: # once (2.45ms+1.04ms) by Moose::Exporter::BEGIN@11 at line 14
use Try::Tiny;
# spent 3.49ms making 1 call to Class::MOP::BEGIN@14 # spent 236µs making 1 call to Exporter::import
15
163416µs18.11ms
# spent 8.11ms (2.12+5.99) within Class::MOP::BEGIN@16 which was called: # once (2.12ms+5.99ms) by Moose::Exporter::BEGIN@11 at line 16
use Class::MOP::Mixin::AttributeCore;
# spent 8.11ms making 1 call to Class::MOP::BEGIN@16
173425µs13.13ms
# spent 3.13ms (2.28+854µs) within Class::MOP::BEGIN@17 which was called: # once (2.28ms+854µs) by Moose::Exporter::BEGIN@11 at line 17
use Class::MOP::Mixin::HasAttributes;
# spent 3.13ms making 1 call to Class::MOP::BEGIN@17
183431µs122.3ms
# spent 22.3ms (4.06+18.2) within Class::MOP::BEGIN@18 which was called: # once (4.06ms+18.2ms) by Moose::Exporter::BEGIN@11 at line 18
use Class::MOP::Mixin::HasMethods;
# spent 22.3ms making 1 call to Class::MOP::BEGIN@18
193433µs1109ms
# spent 109ms (24.4+84.4) within Class::MOP::BEGIN@19 which was called: # once (24.4ms+84.4ms) by Moose::Exporter::BEGIN@11 at line 19
use Class::MOP::Class;
# spent 109ms making 1 call to Class::MOP::BEGIN@19
203530µs19.87ms
# spent 9.87ms (8.56+1.31) within Class::MOP::BEGIN@20 which was called: # once (8.56ms+1.31ms) by Moose::Exporter::BEGIN@11 at line 20
use Class::MOP::Attribute;
# spent 9.87ms making 1 call to Class::MOP::BEGIN@20
213268µs134µs
# spent 34µs within Class::MOP::BEGIN@21 which was called: # once (34µs+0s) by Moose::Exporter::BEGIN@11 at line 21
use Class::MOP::Method;
# 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 Moose::Exporter::BEGIN@11 at line 30
BEGIN {
24 *IS_RUNNING_ON_5_10 = ($] < 5.009_005)
25 ? sub () { 0 }
26231µ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;
3018.14ms129µs}
# spent 29µs making 1 call to Class::MOP::BEGIN@23
31
3215µsour $VERSION = '1.11';
3313µsour $XS_VERSION = $VERSION;
341100µs$VERSION = eval $VERSION;
# spent 12µs executing statements in string eval
3514µsour $AUTHORITY = 'cpan:STEVAN';
36
3714µsrequire XSLoader;
381294µs1262µsXSLoader::load( __PACKAGE__, $XS_VERSION );
# spent 262µ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.
4628µ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 }
51370249.2ms
# spent 35.6ms within Class::MOP::get_metaclass_by_name which was called 3702 times, avg 10µs/call: # 3125 times (30.3ms+0s) by Class::MOP::Class::initialize at line 45 of Class/MOP/Class.pm, avg 10µs/call # 273 times (2.31ms+0s) by Class::MOP::Class::_single_metaclass_is_compatible at line 280 of Class/MOP/Class.pm, avg 8µs/call # 98 times (793µs+0s) by Class::MOP::Class::_construct_class_instance at line 86 of Class/MOP/Class.pm, avg 8µs/call # 39 times (415µs+0s) by Class::MOP::Class::_class_metaclass_is_compatible at line 250 of Class/MOP/Class.pm, avg 11µs/call # 38 times (316µs+0s) by Class::MOP::Package::initialize at line 30 of Class/MOP/Package.pm, avg 8µs/call # 35 times (451µs+0s) by Moose::Role::init_meta at line 120 of Moose/Role.pm, avg 13µs/call # 35 times (340µs+0s) by Moose::Meta::Role::initialize at line 171 of Moose/Meta/Role.pm, avg 10µs/call # 34 times (314µs+0s) by Moose::Meta::Class::initialize at line 68 of Moose/Meta/Class.pm, avg 9µs/call # 25 times (309µs+0s) by Moose::init_meta at line 167 of Moose.pm, avg 12µs/call
sub get_metaclass_by_name { $METAS{$_[0]} }
521362.09ms
# spent 1.85ms within Class::MOP::store_metaclass_by_name which was called 136 times, avg 14µs/call: # 98 times (1.33ms+0s) by Class::MOP::Class::_construct_class_instance at line 111 of Class/MOP/Class.pm, avg 14µs/call # 38 times (516µs+0s) by Class::MOP::Package::initialize at line 37 of Class/MOP/Package.pm, avg 14µs/call
sub store_metaclass_by_name { $METAS{$_[0]} = $_[1] }
53 sub weaken_metaclass { weaken($METAS{$_[0]}) }
541935.15ms1931.20ms
# spent 4.98ms (3.78+1.20) within Class::MOP::metaclass_is_weak which was called 193 times, avg 26µs/call: # 138 times (2.68ms+846µs) by Class::MOP::Class::_construct_instance at line 581 of Class/MOP/Class.pm, avg 26µs/call # 55 times (1.10ms+354µs) by Class::MOP::Class::_inline_preserve_weak_metaclasses at line 745 of Class/MOP/Class.pm, avg 26µs/call
sub metaclass_is_weak { isweak($METAS{$_[0]}) }
# spent 1.20ms making 193 calls to Scalar::Util::isweak, avg 6µs/call
55 sub does_metaclass_exist { exists $METAS{$_[0]} && defined $METAS{$_[0]} }
56 sub remove_metaclass_by_name { delete $METAS{$_[0]}; return }
57
58 # This handles instances as well as class names
59
# spent 17.7ms (14.8+2.89) within Class::MOP::class_of which was called 519 times, avg 34µs/call: # 175 times (5.50ms+1.05ms) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:321] at line 321 of Moose/Exporter.pm, avg 37µs/call # 134 times (3.07ms+578µs) by Moose::Meta::Class::excludes_role at line 240 of Moose/Meta/Class.pm, avg 27µs/call # 66 times (2.12ms+442µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:125] at line 96 of Moose/Exporter.pm, avg 39µs/call # 45 times (1.22ms+234µs) by Moose::Util::_apply_all_roles at line 114 of Moose/Util.pm, avg 32µs/call # 41 times (1.20ms+249µs) by Class::MOP::Class::_superclasses_updated at line 1010 of Class/MOP/Class.pm, avg 35µs/call # 39 times (1.23ms+241µs) by Moose::Meta::Class::superclasses at line 473 of Moose/Meta/Class.pm, avg 38µs/call # 9 times (210µs+38µs) by Moose::Meta::Attribute::BEGIN@20 at line 693 of Moose/Util/TypeConstraints.pm, avg 28µs/call # 5 times (138µs+30µs) by Moose::Object::does at line 122 of Moose/Object.pm, avg 34µs/call # 2 times (57µs+15µs) by Moose::Meta::Attribute::clone at line 236 of Moose/Meta/Attribute.pm, avg 36µs/call # 2 times (59µs+10µs) by Moose::Meta::TypeCoercion::new at line 34 of Moose/Meta/TypeCoercion.pm, avg 34µs/call # once (29µs+6µs) by Class::MOP::Object::_new at line 22 of Class/MOP/Object.pm
sub class_of {
60155718.9ms return unless defined $_[0];
615192.89ms my $class = blessed($_[0]) || $_[0];
# spent 2.89ms making 519 calls to Scalar::Util::blessed, avg 6µ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.47ms (1.03+442µs) within Class::MOP::_class_to_pmfile which was called 34 times, avg 43µs/call: # 34 times (1.03ms+442µs) by Class::MOP::load_first_existing_class at line 111, avg 43µs/call
sub _class_to_pmfile {
731361.62ms my $class = shift;
74
75 my $file = $class . '.pm';
7634443µs $file =~ s{::}{/}g;
# spent 443µs making 34 calls to Class::MOP::CORE:subst, avg 13µs/call
77
78 return $file;
79}
80
81
# spent 1.34s (21.7ms+1.32) within Class::MOP::load_first_existing_class which was called 238 times, avg 5.65ms/call: # 232 times (20.8ms+1.32s) by Class::MOP::load_class at line 137, avg 5.78ms/call # 6 times (894µs+3.06ms) by Moose::Util::resolve_metaclass_alias at line 202 of Moose/Util.pm, avg 659µs/call
sub load_first_existing_class {
82247425.6ms23815.1ms my $classes = Data::OptList::mkopt(\@_)
# spent 15.1ms making 238 calls to Data::OptList::mkopt, avg 64µs/call
83 or return;
84
85 foreach my $class (@{ $classes }) {
86 my $name = $class->[0];
8724412.2ms unless ( _is_valid_class_name($name) ) {
# spent 12.2ms making 244 calls to Class::MOP::_is_valid_class_name, avg 50µ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) {
10011223µs return $name if is_class_loaded($name, $options);
# spent 223µs making 11 calls to Class::MOP::is_class_loaded, avg 20µs/call
101550µs if (is_class_loaded($name)) {
# spent 50µs making 5 calls to Class::MOP::is_class_loaded, avg 10µ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 {
1082304.28ms return $name if is_class_loaded($name);
# spent 4.28ms making 230 calls to Class::MOP::is_class_loaded, avg 19µs/call
109 }
110
111341.47ms my $file = _class_to_pmfile($name);
# spent 1.47ms making 34 calls to Class::MOP::_class_to_pmfile, avg 43µs/call
112
# spent 1.79s (59.1ms+1.73) within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] which was called 34 times, avg 52.8ms/call: # 34 times (59.1ms+1.73s) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 52.8ms/call
return $name if try {
11313017.4ms local $SIG{__DIE__};
114 require $file;
115 $name->VERSION($options->{-version})
116 if defined $options->{-version};
117 return 1;
118 }
119
# spent 261µs (112+149) within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:125] which was called 3 times, avg 87µs/call: # 3 times (112µs+149µs) by Try::Tiny::try at line 100 of Try/Tiny.pm, avg 87µs/call
catch {
1206267µs6149µs unless (/^Can't locate \Q$file\E in \@INC/) {
# spent 122µs making 3 calls to Class::MOP::CORE:regcomp, avg 41µs/call # spent 27µs making 3 calls to Class::MOP::CORE:match, avg 9µs/call
121 confess "Couldn't load class ($name) because: $_";
122 }
123
124 return;
12568891ms };
# spent 1.80s making 34 calls to Try::Tiny::try, avg 52.9ms/call, recursion: max depth 3, sum of overlapping time 907ms # spent 730µs making 34 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 1.35s (6.90ms+1.34) within Class::MOP::load_class which was called 232 times, avg 5.80ms/call: # 55 times (1.55ms+10.9ms) by Class::MOP::Class::_inline_constructor at line 1469 of Class/MOP/Class.pm, avg 226µs/call # 45 times (1.75ms+802ms) by Moose::Util::_apply_all_roles at line 113 of Moose/Util.pm, avg 17.9ms/call # 39 times (1.06ms+7.18ms) by Moose::Meta::Class::superclasses at line 472 of Moose/Meta/Class.pm, avg 211µs/call # 39 times (944µs+3.06ms) by Moose::Meta::Role::apply at line 450 of Moose/Meta/Role.pm, avg 103µs/call # 24 times (650µs+4.24ms) by Class::MOP::Class::_inline_destructor at line 1501 of Class/MOP/Class.pm, avg 204µs/call # 14 times (389µs+8.25ms) by Class::MOP::MiniTrait::apply at line 14 of Class/MOP/MiniTrait.pm, avg 617µs/call # 10 times (350µs+415ms) by Moose::Meta::Attribute::Native::Trait::_native_accessor_class_for at line 172 of Moose/Meta/Attribute/Native/Trait.pm, avg 41.5ms/call # 3 times (78µs+169µs) by Moose::Meta::Role::Composite::apply_params at line 122 of Moose/Meta/Role/Composite.pm, avg 82µs/call # 2 times (86µs+88.1ms) by Moose::Meta::Attribute::Custom::Trait::Array::register_implementation or Moose::Meta::Attribute::Custom::Trait::Hash::register_implementation at line 24 of Moose/Meta/Attribute/Native.pm, avg 44.1ms/call # once (35µs+261µs) by metaclass::import at line 29 of metaclass.pm
sub load_class {
1374646.27ms2321.34s load_first_existing_class($_[0], ref $_[1] ? $_[1] : ());
# spent 1.85s making 232 calls to Class::MOP::load_first_existing_class, avg 7.97ms/call, recursion: max depth 3, sum of overlapping time 509ms
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 12.7ms (7.51+5.23) within Class::MOP::_is_valid_class_name which was called 254 times, avg 50µs/call: # 244 times (7.21ms+5.00ms) by Class::MOP::load_first_existing_class at line 87, avg 50µs/call # 10 times (293µs+234µs) by Class::MOP::Module::_instantiate_module at line 61 of Class/MOP/Module.pm, avg 53µs/call
sub _is_valid_class_name {
146127013.1ms my $class = shift;
147
148 return 0 if ref($class);
149 return 0 unless defined($class);
150 return 0 unless length($class);
151
1522545.23ms return 1 if $class =~ /^\w+(?:::\w+)*$/;
# spent 5.23ms making 254 calls to Class::MOP::CORE:match, avg 21µ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
184Class::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 },
19269861µs
# spent 714µs within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:192] which was called 69 times, avg 10µs/call: # 35 times (380µs+0s) by Moose::Meta::Role::_new at line 12 of generated method (unknown origin), avg 11µs/call # 34 times (335µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 10µs/call
default => sub { {} }
193177µs35.88ms ))
# spent 3.03ms making 1 call to Class::MOP::Mixin::meta # spent 2.64ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 212µs making 1 call to Class::MOP::Attribute::new
194);
195
196157µs31.75msClass::MOP::Mixin::HasMethods->meta->add_attribute(
# spent 1.54ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 133µs making 1 call to Class::MOP::Attribute::new # spent 85µ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
208156µs31.67msClass::MOP::Mixin::HasMethods->meta->add_attribute(
# spent 1.45ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 140µs making 1 call to Class::MOP::Attribute::new # spent 83µ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
223Class::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 },
23472884µs
# spent 686µs within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:234] which was called 72 times, avg 10µs/call: # 35 times (322µs+0s) by Moose::Meta::Role::_new at line 60 of generated method (unknown origin), avg 9µs/call # 34 times (335µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 10µ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
default => sub { {} }
235169µs33.70ms ))
# spent 1.99ms making 1 call to Class::MOP::Mixin::meta # spent 1.56ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 155µs making 1 call to Class::MOP::Attribute::new
236);
237
238154µs31.68msClass::MOP::Mixin::HasAttributes->meta->add_attribute(
# spent 1.48ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 119µs making 1 call to Class::MOP::Attribute::new # spent 83µ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
253164µs33.96msClass::MOP::Package->meta->add_attribute(
# spent 2.23ms making 1 call to Class::MOP::Object::meta # spent 1.62ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 114µ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
267Class::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,
27672857µs
# spent 652µs within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:276] which was called 72 times, avg 9µs/call: # 35 times (304µs+0s) by Moose::Meta::Role::_new at line 90 of generated method (unknown origin), avg 9µs/call # 34 times (321µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 9µ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
default => sub { \undef }
277164µs31.94ms ))
# spent 1.71ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 151µ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
293Class::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,
30272827µs
# spent 635µs within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:302] which was called 72 times, avg 9µs/call: # 35 times (313µs+0s) by Moose::Meta::Role::_new at line 120 of generated method (unknown origin), avg 9µs/call # 34 times (296µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, 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
default => sub { \undef }
303180µs33.57ms ))
# spent 1.90ms making 1 call to Class::MOP::Object::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
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
312Class::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,
32172893µs
# spent 676µs within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:321] which was called 72 times, avg 9µs/call: # 35 times (331µs+0s) by Moose::Meta::Role::_new at line 63 of generated method (unknown origin), avg 9µs/call # 34 times (317µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 9µs/call # 3 times (28µs+0s) by Moose::Meta::Role::Composite::_new at line 69 of generated method (unknown origin), avg 9µs/call
default => sub { \undef }
322161µs31.82ms ))
# spent 1.59ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 147µs making 1 call to Class::MOP::Attribute::new # spent 82µs making 1 call to Class::MOP::Object::meta
323);
324
325## --------------------------------------------------------
326## Class::MOP::Class
327
328Class::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,
33734418µs
# spent 389µs within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:337] which was called 34 times, avg 11µs/call: # 34 times (389µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 11µs/call
default => sub { \undef }
338184µs36.29ms ))
# spent 4.16ms making 1 call to Class::MOP::Object::meta # spent 1.97ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 153µs making 1 call to Class::MOP::Attribute::new
339);
340
341146µs31.86msClass::MOP::Class->meta->add_attribute(
# spent 1.53ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 239µs making 1 call to Class::MOP::Attribute::new # spent 87µ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
356149µs31.87msClass::MOP::Class->meta->add_attribute(
# spent 1.67ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 119µs making 1 call to Class::MOP::Attribute::new # spent 83µ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
365165µs32.39msClass::MOP::Class->meta->add_attribute(
# spent 2.11ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 154µs making 1 call to Class::MOP::Attribute::new # spent 127µ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
374170µs32.53msClass::MOP::Class->meta->add_attribute(
# spent 2.22ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 187µs making 1 call to Class::MOP::Attribute::new # spent 128µ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
384156µs32.10msClass::MOP::Class->meta->add_attribute(
# spent 1.83ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 155µs making 1 call to Class::MOP::Attribute::new # spent 113µ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
4001148µs34.44msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.42ms making 1 call to Class::MOP::Mixin::meta # spent 1.88ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 146µ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
414160µs33.20msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.92ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 177µs making 1 call to Class::MOP::Attribute::new # spent 104µ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
4211124µs32.99msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.58ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 270µs making 1 call to Class::MOP::Attribute::new # spent 142µ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
428149µs32.28msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.06ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 141µs making 1 call to Class::MOP::Attribute::new # spent 85µ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
435143µs31.83msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 1.51ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 240µs making 1 call to Class::MOP::Attribute::new # spent 82µ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
441146µs32.32msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.10ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 139µs making 1 call to Class::MOP::Attribute::new # spent 83µ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
448146µs32.31msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.09ms 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::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
455146µs32.42msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.20ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 136µs making 1 call to Class::MOP::Attribute::new # spent 82µ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
462147µs32.33msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.10ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 140µs making 1 call to Class::MOP::Attribute::new # spent 85µ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
469150µs32.34msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.10ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 141µs making 1 call to Class::MOP::Attribute::new # spent 103µ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
476143µs31.68msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 1.46ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 136µs making 1 call to Class::MOP::Attribute::new # spent 83µ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
483151µs33.13msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.91ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 136µs making 1 call to Class::MOP::Attribute::new # spent 82µ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
493152µs34.50msClass::MOP::Attribute->meta->add_attribute(
# spent 2.83ms making 1 call to Class::MOP::Object::meta # spent 1.53ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 143µ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
507Class::MOP::Attribute->meta->add_attribute(
508 Class::MOP::Attribute->new('associated_methods' => (
509 reader => { 'associated_methods' => \&Class::MOP::Attribute::associated_methods },
5101221.75ms
# spent 1.42ms within Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:510] which was called 122 times, avg 12µs/call: # 116 times (1.35ms+0s) by Moose::Meta::Attribute::_new at line 18 of generated method (unknown origin), avg 12µs/call # 6 times (65µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 43 of Class/MOP/Mixin/AttributeCore.pm, avg 11µs/call
default => sub { [] }
511151µs31.65ms ))
# spent 1.39ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 170µs making 1 call to Class::MOP::Attribute::new # spent 84µs making 1 call to Class::MOP::Object::meta
512);
513
514Class::MOP::Attribute->meta->add_method('clone' => sub {
515 my $self = shift;
516 $self->meta->clone_object($self, @_);
517132µs2419µs});
# spent 334µs making 1 call to Class::MOP::Mixin::HasMethods::add_method # spent 85µs making 1 call to Class::MOP::Object::meta
518
519## --------------------------------------------------------
520## Class::MOP::Method
521156µs33.38msClass::MOP::Method->meta->add_attribute(
# spent 1.74ms making 1 call to Class::MOP::Object::meta # spent 1.49ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 149µ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
527144µs32.01msClass::MOP::Method->meta->add_attribute(
# spent 1.82ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 112µs making 1 call to Class::MOP::Attribute::new # spent 84µ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
533143µs32.07msClass::MOP::Method->meta->add_attribute(
# spent 1.87ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 112µs making 1 call to Class::MOP::Attribute::new # spent 83µ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
539144µs32.00msClass::MOP::Method->meta->add_attribute(
# spent 1.79ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 119µs making 1 call to Class::MOP::Attribute::new # spent 86µ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
545148µs33.00msClass::MOP::Method->meta->add_attribute(
# spent 2.80ms 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
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
560150µs32.74msClass::MOP::Method::Wrapped->meta->add_attribute(
# spent 1.84ms making 1 call to Class::MOP::Object::meta # spent 792µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 114µ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
567162µs33.73msClass::MOP::Method::Generated->meta->add_attribute(
# spent 1.81ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 1.75ms making 1 call to Class::MOP::Object::meta # spent 169µ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
574143µs32.01msClass::MOP::Method::Generated->meta->add_attribute(
# spent 1.81ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 113µs making 1 call to Class::MOP::Attribute::new # spent 85µ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
584158µs33.80msClass::MOP::Method::Inlined->meta->add_attribute(
# spent 1.84ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 1.84ms making 1 call to Class::MOP::Object::meta # spent 116µ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
593158µs33.38msClass::MOP::Method::Accessor->meta->add_attribute(
# spent 1.82ms 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
601142µs31.93msClass::MOP::Method::Accessor->meta->add_attribute(
# spent 1.71ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 133µs making 1 call to Class::MOP::Attribute::new # spent 85µ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
610Class::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 { +{} }
616170µs33.90ms ))
# spent 1.90ms making 1 call to Class::MOP::Object::meta # spent 1.84ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 171µs making 1 call to Class::MOP::Attribute::new
617);
618
619145µs31.74msClass::MOP::Method::Constructor->meta->add_attribute(
# spent 1.54ms 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
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
635158µs33.49msClass::MOP::Instance->meta->add_attribute(
# spent 1.77ms making 1 call to Class::MOP::Object::meta # spent 1.60ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 115µ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
641145µs31.58msClass::MOP::Instance->meta->add_attribute(
# spent 1.38ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 111µs making 1 call to Class::MOP::Attribute::new # spent 87µ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
650144µs31.54msClass::MOP::Instance->meta->add_attribute(
# spent 1.35ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 109µ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
656162µs31.76msClass::MOP::Instance->meta->add_attribute(
# spent 1.53ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 145µs making 1 call to Class::MOP::Attribute::new # spent 82µ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
6621130µs31.69msClass::MOP::Instance->meta->add_attribute(
# spent 1.49ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 114µ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
672156µs26.56msClass::MOP::Object->meta->_add_meta_method('meta');
# spent 6.47ms making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method # spent 91µ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
678142µs23.23msClass::MOP::Mixin->meta->_add_meta_method('meta');
# spent 3.15ms making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method # spent 83µs making 1 call to Class::MOP::Mixin::meta
679
6801428µsrequire 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
684141µs2889µsClass::MOP::Instance->meta->get_meta_instance;
# spent 780µs making 1 call to Class::MOP::Class::get_meta_instance # spent 109µs making 1 call to Class::MOP::Object::meta
685
686# pretend the add_method never happenned. it hasn't yet affected anything
687113µs173µsundef Class::MOP::Instance->meta->{_package_cache_flag};
# spent 73µ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,
6991408µs2687.1ms) for qw/
# spent 86.2ms making 13 calls to Class::MOP::Class::make_immutable, avg 6.63ms/call # spent 933µs making 13 calls to Class::MOP::Object::meta, avg 72µ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
71812µs/;
719
720$_->meta->make_immutable(
721 inline_constructor => 0,
722 constructor_name => undef,
723 inline_accessors => 0,
7241125µs82.89ms) for qw/
# spent 2.60ms making 4 calls to Class::MOP::Class::make_immutable, avg 650µs/call # spent 291µs making 4 calls to Class::MOP::Mixin::meta, avg 73µs/call
725 Class::MOP::Mixin
726 Class::MOP::Mixin::AttributeCore
727 Class::MOP::Mixin::HasAttributes
728 Class::MOP::Mixin::HasMethods
72912µs/;
730
7311425µs1;
732
733__END__
 
# spent 5.26ms within Class::MOP::CORE:match which was called 257 times, avg 20µs/call: # 254 times (5.23ms+0s) by Class::MOP::_is_valid_class_name at line 152, avg 21µs/call # 3 times (27µ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
sub Class::MOP::CORE:match; # opcode
# spent 122µs within Class::MOP::CORE:regcomp which was called 3 times, avg 41µs/call: # 3 times (122µs+0s) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:125] at line 120, avg 41µs/call
sub Class::MOP::CORE:regcomp; # opcode
# spent 443µs within Class::MOP::CORE:subst which was called 34 times, avg 13µs/call: # 34 times (443µs+0s) by Class::MOP::_class_to_pmfile at line 76, avg 13µs/call
sub Class::MOP::CORE:subst; # opcode
# spent 242µs within Class::MOP::__ANON__ which was called 51 times, avg 5µs/call: # 51 times (242µs+0s) by Class::MOP::Class::class_precedence_list at line 1046 of Class/MOP/Class.pm, avg 5µs/call
sub Class::MOP::__ANON__; # xsub
# spent 589µs within Class::MOP::bootstrap which was called: # once (589µs+0s) by DynaLoader::bootstrap at line 223 of DynaLoader.pm
sub Class::MOP::bootstrap; # xsub
# spent 11.5ms within Class::MOP::get_code_info which was called 1338 times, avg 9µs/call: # 1051 times (9.34ms+0s) by Class::MOP::Mixin::HasMethods::add_method at line 76 of Class/MOP/Mixin/HasMethods.pm, avg 9µs/call # 268 times (1.96ms+0s) by Class::MOP::Mixin::HasMethods::_code_is_mine at line 90 of Class/MOP/Mixin/HasMethods.pm, avg 7µs/call # 15 times (143µs+0s) by Moose::Meta::Role::Application::ToClass::apply_override_method_modifiers at line 206 of Moose/Meta/Role/Application/ToClass.pm, avg 10µs/call # 4 times (36µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 243 of Moose/Exporter.pm, avg 9µs/call
sub Class::MOP::get_code_info; # xsub
# spent 5.84ms within Class::MOP::is_class_loaded which was called 321 times, avg 18µs/call: # 230 times (4.28ms+0s) by Class::MOP::load_first_existing_class at line 108, avg 19µs/call # 75 times (1.29ms+0s) by Class::MOP::Class::_immutable_metaclass at line 1378 of Class/MOP/Class.pm, avg 17µs/call # 11 times (223µs+0s) by Class::MOP::load_first_existing_class at line 100, avg 20µs/call # 5 times (50µs+0s) by Class::MOP::load_first_existing_class at line 101, avg 10µs/call
sub Class::MOP::is_class_loaded; # xsub