← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:39:01 2010
Reported on Wed Nov 17 22:07:20 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm
StatementsExecuted 12623 statements in 184ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
351165.4ms4.77sClass::MOP::::__ANON__[:118]Class::MOP::__ANON__[:118]
38239636.6ms36.6msClass::MOP::::get_metaclass_by_nameClass::MOP::get_metaclass_by_name
3092228.4ms3.50sClass::MOP::::load_first_existing_classClass::MOP::load_first_existing_class (recurses: max depth 4, inclusive time 1.35s)
11122.9ms86.3msClass::MOP::::BEGIN@19Class::MOP::BEGIN@19
21144318.5ms18.5msClass::MOP::::get_code_infoClass::MOP::get_code_info (xsub)
63511917.8ms21.2msClass::MOP::::class_ofClass::MOP::class_of
325229.36ms15.8msClass::MOP::::_is_valid_class_nameClass::MOP::_is_valid_class_name
303988.69ms3.50sClass::MOP::::load_classClass::MOP::load_class (recurses: max depth 4, inclusive time 1.36s)
1118.03ms9.42msClass::MOP::::BEGIN@20Class::MOP::BEGIN@20
396427.65ms7.65msClass::MOP::::is_class_loadedClass::MOP::is_class_loaded (xsub)
328216.49ms6.49msClass::MOP::::CORE:matchClass::MOP::CORE:match (opcode)
1115.72ms8.69msClass::MOP::::BEGIN@9Class::MOP::BEGIN@9
1114.23ms22.1msClass::MOP::::BEGIN@18Class::MOP::BEGIN@18
203223.95ms5.19msClass::MOP::::metaclass_is_weakClass::MOP::metaclass_is_weak
1112.66ms8.89msClass::MOP::::BEGIN@16Class::MOP::BEGIN@16
1112.41ms3.26msClass::MOP::::BEGIN@17Class::MOP::BEGIN@17
1112.40ms2.92msClass::MOP::::BEGIN@13Class::MOP::BEGIN@13
1112.37ms3.33msClass::MOP::::BEGIN@14Class::MOP::BEGIN@14
170222.21ms2.21msClass::MOP::::store_metaclass_by_nameClass::MOP::store_metaclass_by_name
122221.35ms1.35msClass::MOP::::__ANON__[:510]Class::MOP::__ANON__[:510]
113321.26ms1.26msClass::MOP::::__ANON__[:234]Class::MOP::__ANON__[:234]
113321.10ms1.10msClass::MOP::::__ANON__[:276]Class::MOP::__ANON__[:276]
35111.08ms1.58msClass::MOP::::_class_to_pmfileClass::MOP::_class_to_pmfile
113321.05ms1.05msClass::MOP::::__ANON__[:321]Class::MOP::__ANON__[:321]
113321.05ms1.05msClass::MOP::::__ANON__[:302]Class::MOP::__ANON__[:302]
103221.04ms1.04msClass::MOP::::__ANON__[:192]Class::MOP::__ANON__[:192]
3511495µs495µsClass::MOP::::CORE:substClass::MOP::CORE:subst (opcode)
3411382µs382µsClass::MOP::::__ANON__[:337]Class::MOP::__ANON__[:337]
5111261µs261µsClass::MOP::::__ANON__Class::MOP::__ANON__ (xsub)
111204µs232µsClass::MOP::::BEGIN@4Class::MOP::BEGIN@4
311120µs265µsClass::MOP::::__ANON__[:125]Class::MOP::__ANON__[:125]
311120µs120µsClass::MOP::::CORE:regcompClass::MOP::CORE:regcomp (opcode)
111107µs107µsClass::MOP::::BEGIN@7Class::MOP::BEGIN@7
11181µs177µsClass::MOP::::BEGIN@5Class::MOP::BEGIN@5
11141µs199µsClass::MOP::::BEGIN@11Class::MOP::BEGIN@11
11139µs237µsClass::MOP::::BEGIN@12Class::MOP::BEGIN@12
11135µs35µsClass::MOP::::BEGIN@21Class::MOP::BEGIN@21
11130µs30µ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
43253µs2260µs
# spent 232µs (204+28) within Class::MOP::BEGIN@4 which was called: # once (204µs+28µs) by Moose::Exporter::BEGIN@11 at line 4
use strict;
# spent 232µs making 1 call to Class::MOP::BEGIN@4 # spent 28µs making 1 call to strict::import
53158µs2274µs
# spent 177µs (81+96) within Class::MOP::BEGIN@5 which was called: # once (81µs+96µs) by Moose::Exporter::BEGIN@11 at line 5
use warnings;
# spent 177µs making 1 call to Class::MOP::BEGIN@5 # spent 96µs making 1 call to warnings::import
6
73221µs1107µs
# spent 107µs within Class::MOP::BEGIN@7 which was called: # once (107µs+0s) by Moose::Exporter::BEGIN@11 at line 7
use 5.008;
# spent 107µs making 1 call to Class::MOP::BEGIN@7
8
93709µs18.69ms
# spent 8.69ms (5.72+2.96) within Class::MOP::BEGIN@9 which was called: # once (5.72ms+2.96ms) by Moose::Exporter::BEGIN@11 at line 9
use MRO::Compat;
# spent 8.69ms making 1 call to Class::MOP::BEGIN@9
10
113112µs2358µs
# spent 199µs (41+159) within Class::MOP::BEGIN@11 which was called: # once (41µs+159µs) by Moose::Exporter::BEGIN@11 at line 11
use Carp 'confess';
# spent 199µs making 1 call to Class::MOP::BEGIN@11 # spent 159µs making 1 call to Exporter::import
123143µs2436µs
# spent 237µs (39+198) within Class::MOP::BEGIN@12 which was called: # once (39µs+198µs) by Moose::Exporter::BEGIN@11 at line 12
use Scalar::Util 'weaken', 'isweak', 'reftype', 'blessed';
# spent 237µs making 1 call to Class::MOP::BEGIN@12 # spent 198µs making 1 call to Exporter::import
133501µs22.94ms
# spent 2.92ms (2.40+514µs) within Class::MOP::BEGIN@13 which was called: # once (2.40ms+514µs) by Moose::Exporter::BEGIN@11 at line 13
use Data::OptList;
# spent 2.92ms making 1 call to Class::MOP::BEGIN@13 # spent 24µs making 1 call to Sub::Install::__ANON__[Sub/Install.pm:284]
143473µs23.55ms
# spent 3.33ms (2.37+966µs) within Class::MOP::BEGIN@14 which was called: # once (2.37ms+966µs) by Moose::Exporter::BEGIN@11 at line 14
use Try::Tiny;
# spent 3.33ms making 1 call to Class::MOP::BEGIN@14 # spent 219µs making 1 call to Exporter::import
15
163444µs18.89ms
# spent 8.89ms (2.66+6.23) within Class::MOP::BEGIN@16 which was called: # once (2.66ms+6.23ms) by Moose::Exporter::BEGIN@11 at line 16
use Class::MOP::Mixin::AttributeCore;
# spent 8.89ms making 1 call to Class::MOP::BEGIN@16
173454µs13.26ms
# spent 3.26ms (2.41+843µs) within Class::MOP::BEGIN@17 which was called: # once (2.41ms+843µs) by Moose::Exporter::BEGIN@11 at line 17
use Class::MOP::Mixin::HasAttributes;
# spent 3.26ms making 1 call to Class::MOP::BEGIN@17
183445µs122.1ms
# spent 22.1ms (4.23+17.8) within Class::MOP::BEGIN@18 which was called: # once (4.23ms+17.8ms) by Moose::Exporter::BEGIN@11 at line 18
use Class::MOP::Mixin::HasMethods;
# spent 22.1ms making 1 call to Class::MOP::BEGIN@18
193484µs186.3ms
# spent 86.3ms (22.9+63.4) within Class::MOP::BEGIN@19 which was called: # once (22.9ms+63.4ms) by Moose::Exporter::BEGIN@11 at line 19
use Class::MOP::Class;
# spent 86.3ms making 1 call to Class::MOP::BEGIN@19
203466µs19.42ms
# spent 9.42ms (8.03+1.40) within Class::MOP::BEGIN@20 which was called: # once (8.03ms+1.40ms) by Moose::Exporter::BEGIN@11 at line 20
use Class::MOP::Attribute;
# spent 9.42ms making 1 call to Class::MOP::BEGIN@20
213283µs135µs
# spent 35µs within Class::MOP::BEGIN@21 which was called: # once (35µs+0s) by Moose::Exporter::BEGIN@11 at line 21
use Class::MOP::Method;
# spent 35µs making 1 call to Class::MOP::BEGIN@21
22
23
# spent 30µs within Class::MOP::BEGIN@23 which was called: # once (30µs+0s) by Moose::Exporter::BEGIN@11 at line 30
BEGIN {
24 *IS_RUNNING_ON_5_10 = ($] < 5.009_005)
25 ? sub () { 0 }
2618µs : sub () { 1 };
27
28 # this is either part of core or set up appropriately by MRO::Compat
29123µs *check_package_cache_flag = \&mro::get_pkg_gen;
3018.09ms130µs}
# spent 30µs making 1 call to Class::MOP::BEGIN@23
31
3216µsour $VERSION = '1.11';
3313µsour $XS_VERSION = $VERSION;
341104µs$VERSION = eval $VERSION;
# spent 12µs executing statements in string eval
3514µsour $AUTHORITY = 'cpan:STEVAN';
36
3714µsrequire XSLoader;
381901µs1872µsXSLoader::load( __PACKAGE__, $XS_VERSION );
# spent 872µ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 }
51382349.2ms
# spent 36.6ms within Class::MOP::get_metaclass_by_name which was called 3823 times, avg 10µs/call: # 3144 times (30.4ms+0s) by Class::MOP::Class::initialize at line 45 of Class/MOP/Class.pm, avg 10µs/call # 273 times (2.33ms+0s) by Class::MOP::Class::_single_metaclass_is_compatible at line 292 of Class/MOP/Class.pm, avg 9µs/call # 98 times (800µs+0s) by Class::MOP::Class::_construct_class_instance at line 86 of Class/MOP/Class.pm, avg 8µs/call # 72 times (595µs+0s) by Class::MOP::Package::initialize at line 30 of Class/MOP/Package.pm, avg 8µs/call # 69 times (866µs+0s) by Moose::Role::init_meta at line 120 of Moose/Role.pm, avg 13µs/call # 69 times (575µs+0s) by Moose::Meta::Role::initialize at line 165 of Moose/Meta/Role.pm, avg 8µs/call # 39 times (406µs+0s) by Class::MOP::Class::_class_metaclass_is_compatible at line 262 of Class/MOP/Class.pm, avg 10µs/call # 34 times (294µs+0s) by Moose::Meta::Class::initialize at line 68 of Moose/Meta/Class.pm, avg 9µs/call # 25 times (317µs+0s) by Moose::init_meta at line 167 of Moose.pm, avg 13µs/call
sub get_metaclass_by_name { $METAS{$_[0]} }
521702.66ms
# spent 2.21ms within Class::MOP::store_metaclass_by_name which was called 170 times, avg 13µs/call: # 98 times (1.28ms+0s) by Class::MOP::Class::_construct_class_instance at line 111 of Class/MOP/Class.pm, avg 13µs/call # 72 times (923µs+0s) by Class::MOP::Package::initialize at line 37 of Class/MOP/Package.pm, avg 13µs/call
sub store_metaclass_by_name { $METAS{$_[0]} = $_[1] }
53 sub weaken_metaclass { weaken($METAS{$_[0]}) }
542035.28ms2031.24ms
# spent 5.19ms (3.95+1.24) within Class::MOP::metaclass_is_weak which was called 203 times, avg 26µs/call: # 172 times (3.31ms+1.05ms) by Class::MOP::Class::_construct_instance at line 605 of Class/MOP/Class.pm, avg 25µs/call # 31 times (642µs+192µs) by Class::MOP::Method::Constructor::_generate_constructor_method_inline at line 117 of Class/MOP/Method/Constructor.pm, avg 27µs/call
sub metaclass_is_weak { isweak($METAS{$_[0]}) }
# spent 1.24ms making 203 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 21.2ms (17.8+3.44) within Class::MOP::class_of which was called 635 times, avg 33µs/call: # 216 times (6.59ms+1.23ms) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:321] at line 321 of Moose/Exporter.pm, avg 36µs/call # 134 times (3.01ms+565µs) by Moose::Meta::Class::excludes_role at line 240 of Moose/Meta/Class.pm, avg 27µs/call # 100 times (3.08ms+653µs) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:125] at line 96 of Moose/Exporter.pm, avg 37µs/call # 86 times (2.33ms+426µs) by Moose::Util::_apply_all_roles at line 114 of Moose/Util.pm, avg 32µs/call # 41 times (1.14ms+263µs) by Class::MOP::Class::_superclasses_updated at line 869 of Class/MOP/Class.pm, avg 34µs/call # 39 times (1.06ms+210µs) by Moose::Meta::Class::superclasses at line 289 of Moose/Meta/Class.pm, avg 33µs/call # 9 times (201µs+36µs) by Moose::Meta::Attribute::BEGIN@20 at line 693 of Moose/Util/TypeConstraints.pm, avg 26µs/call # 5 times (208µs+28µs) by Moose::Object::does at line 122 of Moose/Object.pm, avg 47µs/call # 2 times (53µs+15µs) by Moose::Meta::Attribute::clone at line 231 of Moose/Meta/Attribute.pm, avg 34µs/call # 2 times (56µs+9µs) by Moose::Meta::TypeCoercion::new at line 34 of Moose/Meta/TypeCoercion.pm, avg 32µs/call # once (29µs+5µs) by Class::MOP::Object::_new at line 22 of Class/MOP/Object.pm
sub class_of {
606351.57ms return unless defined $_[0];
6163512.7ms6353.44ms my $class = blessed($_[0]) || $_[0];
# spent 3.44ms making 635 calls to Scalar::Util::blessed, avg 5µs/call
626359.07ms 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.58ms (1.08+495µs) within Class::MOP::_class_to_pmfile which was called 35 times, avg 45µs/call: # 35 times (1.08ms+495µs) by Class::MOP::load_first_existing_class at line 111, avg 45µs/call
sub _class_to_pmfile {
7335134µs my $class = shift;
74
7535144µs my $file = $class . '.pm';
7635882µs35495µs $file =~ s{::}{/}g;
# spent 495µs making 35 calls to Class::MOP::CORE:subst, avg 14µs/call
77
7835491µs return $file;
79}
80
81
# spent 3.50s (28.4ms+3.47) within Class::MOP::load_first_existing_class which was called 309 times, avg 11.3ms/call: # 303 times (27.5ms+3.47s) by Class::MOP::load_class at line 137, avg 11.5ms/call # 6 times (898µs+2.77ms) by Moose::Util::resolve_metaclass_alias at line 202 of Moose/Util.pm, avg 612µs/call
sub load_first_existing_class {
823093.71ms30918.7ms my $classes = Data::OptList::mkopt(\@_)
# spent 18.7ms making 309 calls to Data::OptList::mkopt, avg 61µs/call
83 or return;
84
853092.01ms foreach my $class (@{ $classes }) {
863151.21ms my $name = $class->[0];
873155.01ms31515.3ms unless ( _is_valid_class_name($name) ) {
# spent 15.3ms making 315 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
93309560µs my $found;
94309594µs my %exceptions;
95
963091.06ms for my $class (@{ $classes }) {
973121.34ms my ($name, $options) = @{ $class };
98
993121.89ms if ($options) {
100442.20ms441.01ms return $name if is_class_loaded($name, $options);
# spent 1.01ms making 44 calls to Class::MOP::is_class_loaded, avg 23µs/call
1019186µs983µs if (is_class_loaded($name)) {
# spent 83µs making 9 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 {
10826811.7ms2685.17ms return $name if is_class_loaded($name);
# spent 5.17ms making 268 calls to Class::MOP::is_class_loaded, avg 19µs/call
109 }
110
11135417µs351.58ms my $file = _class_to_pmfile($name);
# spent 1.58ms making 35 calls to Class::MOP::_class_to_pmfile, avg 45µs/call
112
# spent 4.77s (65.4ms+4.71) within Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] which was called 35 times, avg 136ms/call: # 35 times (65.4ms+4.71s) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 136ms/call
return $name if try {
11335649µs local $SIG{__DIE__};
1143514.3ms require $file;
11532272µs $name->VERSION($options->{-version})
116 if defined $options->{-version};
11732736µs return 1;
118 }
119
# spent 265µs (120+145) within Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:125] which was called 3 times, avg 88µs/call: # 3 times (120µs+145µs) by Try::Tiny::try at line 100 of Try/Tiny.pm, avg 88µs/call
catch {
1203233µs6144µs unless (/^Can't locate \Q$file\E in \@INC/) {
# spent 120µs making 3 calls to Class::MOP::CORE:regcomp, avg 40µs/call # spent 24µs making 3 calls to Class::MOP::CORE:match, avg 8µs/call
121 confess "Couldn't load class ($name) because: $_";
122 }
123
124338µs return;
125351.95ms703.46s };
# spent 4.78s making 35 calls to Try::Tiny::try, avg 136ms/call, recursion: max depth 4, sum of overlapping time 1.32s # spent 785µs making 35 calls to Try::Tiny::catch, avg 22µ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.50s (8.69ms+3.49) within Class::MOP::load_class which was called 303 times, avg 11.5ms/call: # 86 times (2.94ms+1.09s) by Moose::Util::_apply_all_roles at line 113 of Moose/Util.pm, avg 12.7ms/call # 72 times (1.79ms+2.36ms) by Moose::Meta::Role::apply at line 450 of Moose/Meta/Role.pm, avg 58µs/call # 55 times (1.47ms+10.8ms) by Class::MOP::Class::_inline_constructor at line 1328 of Class/MOP/Class.pm, avg 222µs/call # 39 times (1.04ms+6.62ms) by Moose::Meta::Class::superclasses at line 288 of Moose/Meta/Class.pm, avg 196µs/call # 24 times (679µs+4.36ms) by Class::MOP::Class::_inline_destructor at line 1360 of Class/MOP/Class.pm, avg 210µs/call # 14 times (387µs+8.49ms) by Class::MOP::MiniTrait::apply at line 14 of Class/MOP/MiniTrait.pm, avg 634µs/call # 10 times (276µs+-23µs) by Moose::Meta::Role::Composite::apply_params at line 122 of Moose/Meta/Role/Composite.pm, avg 25µs/call # 2 times (86µs+2.37s) 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 1.18s/call # once (25µs+204µs) by metaclass::import at line 29 of metaclass.pm
sub load_class {
1373034.32ms3033.49s load_first_existing_class($_[0], ref $_[1] ? $_[1] : ());
# spent 4.84s making 303 calls to Class::MOP::load_first_existing_class, avg 16.0ms/call, recursion: max depth 4, sum of overlapping time 1.35s
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!
1423033.31ms return 1;
143}
144
145
# spent 15.8ms (9.36+6.47) within Class::MOP::_is_valid_class_name which was called 325 times, avg 49µs/call: # 315 times (9.07ms+6.24ms) by Class::MOP::load_first_existing_class at line 87, avg 49µs/call # 10 times (289µs+232µs) by Class::MOP::Module::_instantiate_module at line 61 of Class/MOP/Module.pm, avg 52µs/call
sub _is_valid_class_name {
1463251.09ms my $class = shift;
147
148325738µs return 0 if ref($class);
149325603µs return 0 unless defined($class);
150325712µs return 0 unless length($class);
151
15232513.1ms3256.47ms return 1 if $class =~ /^\w+(?:::\w+)*$/;
# spent 6.47ms making 325 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
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 '_full_method_map' => \&Class::MOP::Mixin::HasMethods::_full_method_map
191 },
1921031.30ms
# spent 1.04ms within Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:192] which was called 103 times, avg 10µs/call: # 69 times (669µs+0s) by Moose::Meta::Role::_new at line 41 of (eval 74)[Class/MOP/Method/Generated.pm:53], avg 10µs/call # 34 times (372µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm, avg 11µs/call
default => sub { {} }
193181µs36.20ms ))
# spent 3.41ms making 1 call to Class::MOP::Mixin::meta # spent 2.55ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 236µs making 1 call to Class::MOP::Attribute::new
194);
195
196143µs31.69msClass::MOP::Mixin::HasMethods->meta->add_attribute(
# spent 1.49ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 120µs making 1 call to Class::MOP::Attribute::new # spent 84µ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
208144µs31.67msClass::MOP::Mixin::HasMethods->meta->add_attribute(
# spent 1.47ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 114µ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
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 },
2341131.49ms
# spent 1.26ms within Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:234] which was called 113 times, avg 11µs/call: # 69 times (759µs+0s) by Moose::Meta::Role::_new at line 100 of (eval 74)[Class/MOP/Method/Generated.pm:53], avg 11µs/call # 34 times (357µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm, avg 10µs/call # 10 times (147µs+0s) by Moose::Meta::Role::Composite::_new at line 108 of (eval 74)[Class/MOP/Method/Generated.pm:53], avg 15µs/call
default => sub { {} }
235162µs33.67ms ))
# spent 1.98ms making 1 call to Class::MOP::Mixin::meta # spent 1.51ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 173µs making 1 call to Class::MOP::Attribute::new
236);
237
238143µs31.64msClass::MOP::Mixin::HasAttributes->meta->add_attribute(
# spent 1.44ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 118µs making 1 call to Class::MOP::Attribute::new # spent 84µ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
253156µs34.16msClass::MOP::Package->meta->add_attribute(
# spent 2.51ms making 1 call to Class::MOP::Object::meta # spent 1.47ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 188µ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,
2761131.46ms
# spent 1.10ms within Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:276] which was called 113 times, avg 10µs/call: # 69 times (677µs+0s) by Moose::Meta::Role::_new at line 43 of (eval 74)[Class/MOP/Method/Generated.pm:53], avg 10µs/call # 34 times (326µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm, avg 10µs/call # 10 times (96µs+0s) by Moose::Meta::Role::Composite::_new at line 48 of (eval 74)[Class/MOP/Method/Generated.pm:53], avg 10µs/call
default => sub { \undef }
277151µs31.75ms ))
# spent 1.52ms 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
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,
3021131.42ms
# spent 1.05ms within Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:302] which was called 113 times, avg 9µs/call: # 69 times (639µs+0s) by Moose::Meta::Role::_new at line 45 of (eval 74)[Class/MOP/Method/Generated.pm:53], avg 9µs/call # 34 times (320µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm, avg 9µs/call # 10 times (87µs+0s) by Moose::Meta::Role::Composite::_new at line 50 of (eval 74)[Class/MOP/Method/Generated.pm:53], avg 9µs/call
default => sub { \undef }
303164µs33.62ms ))
# spent 2.01ms making 1 call to Class::MOP::Object::meta # spent 1.45ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 150µ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,
3211131.37ms
# spent 1.05ms within Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:321] which was called 113 times, avg 9µs/call: # 69 times (635µs+0s) by Moose::Meta::Role::_new at line 95 of (eval 74)[Class/MOP/Method/Generated.pm:53], avg 9µs/call # 34 times (326µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm, avg 10µs/call # 10 times (89µs+0s) by Moose::Meta::Role::Composite::_new at line 103 of (eval 74)[Class/MOP/Method/Generated.pm:53], avg 9µs/call
default => sub { \undef }
322150µs31.74ms ))
# spent 1.50ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 148µs making 1 call to Class::MOP::Attribute::new # spent 86µ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,
33734471µs
# spent 382µs within Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:337] which was called 34 times, avg 11µs/call: # 34 times (382µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm, avg 11µs/call
default => sub { \undef }
338174µs35.95ms ))
# spent 4.20ms making 1 call to Class::MOP::Object::meta # spent 1.60ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 150µs making 1 call to Class::MOP::Attribute::new
339);
340
341144µs31.73msClass::MOP::Class->meta->add_attribute(
# spent 1.53ms 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
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
356143µs31.70msClass::MOP::Class->meta->add_attribute(
# spent 1.50ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 116µs making 1 call to Class::MOP::Attribute::new # spent 84µ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
365144µs31.63msClass::MOP::Class->meta->add_attribute(
# spent 1.44ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 113µ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
374144µs31.66msClass::MOP::Class->meta->add_attribute(
# spent 1.43ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 152µs making 1 call to Class::MOP::Attribute::new # spent 82µ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
384142µs31.71msClass::MOP::Class->meta->add_attribute(
# spent 1.52ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 108µs making 1 call to Class::MOP::Attribute::new # spent 81µ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
400164µs33.61msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.02ms making 1 call to Class::MOP::Mixin::meta # spent 1.47ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 113µ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
414148µs32.42msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.21ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 111µs making 1 call to Class::MOP::Attribute::new # spent 96µ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
421148µs32.38msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.16ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 137µ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
428147µs32.37msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.18ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 111µs making 1 call to Class::MOP::Attribute::new # spent 82µ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
435142µs31.68msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 1.48ms 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::Mixin::meta
436 Class::MOP::Attribute->new('definition_context' => (
437 reader => { 'definition_context' => \&Class::MOP::Mixin::AttributeCore::definition_context },
438 ))
439);
440
441145µs32.40msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.21ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 109µs making 1 call to Class::MOP::Attribute::new # spent 81µ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
448147µs32.40msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.18ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 133µs making 1 call to Class::MOP::Attribute::new # spent 82µ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.33msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.13ms 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::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.31msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.12ms 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::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
469148µs32.49msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.29ms 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::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.64msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 1.44ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 114µs making 1 call to Class::MOP::Attribute::new # spent 85µ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.06msClass::MOP::Mixin::AttributeCore->meta->add_attribute(
# spent 2.85ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 114µs making 1 call to Class::MOP::Attribute::new # spent 94µ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
493158µs34.81msClass::MOP::Attribute->meta->add_attribute(
# spent 3.22ms making 1 call to Class::MOP::Object::meta # spent 1.47ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 113µ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 },
5101222.06ms
# spent 1.35ms within Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:510] which was called 122 times, avg 11µs/call: # 116 times (1.28ms+0s) by Moose::Meta::Attribute::_new at line 74 of (eval 74)[Class/MOP/Method/Generated.pm:53], avg 11µs/call # 6 times (66µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm, avg 11µs/call
default => sub { [] }
511149µs31.69ms ))
# spent 1.45ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 151µ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µs2454µs});
# spent 372µ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
521156µs33.76msClass::MOP::Method->meta->add_attribute(
# spent 2.10ms making 1 call to Class::MOP::Object::meta # spent 1.52ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 131µ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
527142µs31.62msClass::MOP::Method->meta->add_attribute(
# spent 1.43ms 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
528 Class::MOP::Attribute->new('associated_metaclass' => (
529 reader => { 'associated_metaclass' => \&Class::MOP::Method::associated_metaclass },
530 ))
531);
532
533144µs31.62msClass::MOP::Method->meta->add_attribute(
# spent 1.43ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 109µs making 1 call to Class::MOP::Attribute::new # spent 84µ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
539142µs31.68msClass::MOP::Method->meta->add_attribute(
# spent 1.49ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 107µs making 1 call to Class::MOP::Attribute::new # spent 80µ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µs32.36msClass::MOP::Method->meta->add_attribute(
# spent 2.16ms 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
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
560153µs32.85msClass::MOP::Method::Wrapped->meta->add_attribute(
# spent 2.01ms making 1 call to Class::MOP::Object::meta # spent 722µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 113µ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
567159µs33.66msClass::MOP::Method::Generated->meta->add_attribute(
# spent 2.07ms making 1 call to Class::MOP::Object::meta # spent 1.47ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 116µ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
574152µs32.39msClass::MOP::Method::Generated->meta->add_attribute(
# spent 2.16ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 144µ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
584194µs35.42msClass::MOP::Method::Inlined->meta->add_attribute(
# spent 3.31ms making 1 call to Class::MOP::Object::meta # spent 1.93ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 176µ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
593165µs33.71msClass::MOP::Method::Accessor->meta->add_attribute(
# spent 2.04ms making 1 call to Class::MOP::Object::meta # spent 1.55ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 126µ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
601143µs31.76msClass::MOP::Method::Accessor->meta->add_attribute(
# spent 1.56ms 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
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 { +{} }
616174µs33.63ms ))
# spent 2.00ms making 1 call to Class::MOP::Object::meta # spent 1.48ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 155µs making 1 call to Class::MOP::Attribute::new
617);
618
619142µs31.67msClass::MOP::Method::Constructor->meta->add_attribute(
# spent 1.48ms 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
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
635157µs33.66msClass::MOP::Instance->meta->add_attribute(
# spent 2.04ms making 1 call to Class::MOP::Object::meta # spent 1.48ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 145µ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
641146µs31.71msClass::MOP::Instance->meta->add_attribute(
# spent 1.49ms 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::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
650142µs31.66msClass::MOP::Instance->meta->add_attribute(
# spent 1.47ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 108µs making 1 call to Class::MOP::Attribute::new # spent 82µ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
656160µs31.64msClass::MOP::Instance->meta->add_attribute(
# spent 1.44ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 109µs making 1 call to Class::MOP::Attribute::new # spent 84µ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
662162µs31.77msClass::MOP::Instance->meta->add_attribute(
# spent 1.55ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 127µs making 1 call to Class::MOP::Attribute::new # spent 95µ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
672160µs27.02msClass::MOP::Object->meta->_add_meta_method('meta');
# spent 6.92ms making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method # spent 108µ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
678148µs23.32msClass::MOP::Mixin->meta->_add_meta_method('meta');
# spent 3.24ms making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method # spent 82µs making 1 call to Class::MOP::Mixin::meta
679
6801382µ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
684138µs2923µsClass::MOP::Instance->meta->get_meta_instance;
# spent 819µs making 1 call to Class::MOP::Class::get_meta_instance # spent 104µs making 1 call to Class::MOP::Object::meta
685
686# pretend the add_method never happenned. it hasn't yet affected anything
687113µs174µsundef Class::MOP::Instance->meta->{_package_cache_flag};
# spent 74µ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,
6991405µs26112ms) for qw/
# spent 110ms making 13 calls to Class::MOP::Class::make_immutable, avg 8.50ms/call # spent 1.04ms making 13 calls to Class::MOP::Object::meta, avg 80µ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,
7241127µs83.12ms) for qw/
# spent 2.82ms making 4 calls to Class::MOP::Class::make_immutable, avg 705µs/call # spent 298µs making 4 calls to Class::MOP::Mixin::meta, avg 75µs/call
725 Class::MOP::Mixin
726 Class::MOP::Mixin::AttributeCore
727 Class::MOP::Mixin::HasAttributes
728 Class::MOP::Mixin::HasMethods
72912µs/;
730
7311398µs1;
732
733__END__
 
# spent 6.49ms within Class::MOP::CORE:match which was called 328 times, avg 20µs/call: # 325 times (6.47ms+0s) by Class::MOP::_is_valid_class_name at line 152, avg 20µs/call # 3 times (24µs+0s) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:125] at line 120, avg 8µs/call
sub Class::MOP::CORE:match; # opcode
# spent 120µs within Class::MOP::CORE:regcomp which was called 3 times, avg 40µs/call: # 3 times (120µs+0s) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:125] at line 120, avg 40µs/call
sub Class::MOP::CORE:regcomp; # opcode
# spent 495µs within Class::MOP::CORE:subst which was called 35 times, avg 14µs/call: # 35 times (495µs+0s) by Class::MOP::_class_to_pmfile at line 76, avg 14µs/call
sub Class::MOP::CORE:subst; # opcode
# spent 261µs within Class::MOP::__ANON__ which was called 51 times, avg 5µs/call: # 51 times (261µs+0s) by Class::MOP::Class::class_precedence_list at line 905 of Class/MOP/Class.pm, avg 5µs/call
sub Class::MOP::__ANON__; # xsub
# spent 18.5ms within Class::MOP::get_code_info which was called 2114 times, avg 9µs/call: # 1642 times (15.0ms+0s) by Class::MOP::Mixin::HasMethods::add_method at line 84 of Class/MOP/Mixin/HasMethods.pm, avg 9µs/call # 451 times (3.25ms+0s) by Class::MOP::Mixin::HasMethods::_code_is_mine at line 100 of Class/MOP/Mixin/HasMethods.pm, avg 7µs/call # 17 times (193µs+0s) by Moose::Meta::Role::Application::ToClass::apply_override_method_modifiers at line 206 of Moose/Meta/Role/Application/ToClass.pm, avg 11µs/call # 4 times (34µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 243 of Moose/Exporter.pm, avg 8µs/call
sub Class::MOP::get_code_info; # xsub
# spent 7.65ms within Class::MOP::is_class_loaded which was called 396 times, avg 19µs/call: # 268 times (5.17ms+0s) by Class::MOP::load_first_existing_class at line 108, avg 19µs/call # 75 times (1.39ms+0s) by Class::MOP::Class::_immutable_metaclass at line 1237 of Class/MOP/Class.pm, avg 18µs/call # 44 times (1.01ms+0s) by Class::MOP::load_first_existing_class at line 100, avg 23µs/call # 9 times (83µs+0s) by Class::MOP::load_first_existing_class at line 101, avg 9µs/call
sub Class::MOP::is_class_loaded; # xsub