← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 01.HTTP.t
  Run on Tue May 4 15:25:55 2010
Reported on Tue May 4 15:26:19 2010

File /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Class/MOP/Mixin/AttributeCore.pm
Statements Executed 3422
Statement Execution Time 6.49ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.13ms2.04msClass::MOP::Mixin::AttributeCore::::BEGIN@12Class::MOP::Mixin::AttributeCore::BEGIN@12
47974575µs575µsClass::MOP::Mixin::AttributeCore::::init_argClass::MOP::Mixin::AttributeCore::init_arg
930156496µs496µsClass::MOP::Mixin::AttributeCore::::nameClass::MOP::Mixin::AttributeCore::name (xsub)
17064446µs15.1msClass::MOP::Mixin::AttributeCore::::defaultClass::MOP::Mixin::AttributeCore::default
27542354µs354µsClass::MOP::Mixin::AttributeCore::::has_defaultClass::MOP::Mixin::AttributeCore::has_default
14944350µs350µsClass::MOP::Mixin::AttributeCore::::is_default_a_coderefClass::MOP::Mixin::AttributeCore::is_default_a_coderef
18711269µs269µsClass::MOP::Mixin::AttributeCore::::has_writerClass::MOP::Mixin::AttributeCore::has_writer
18711248µs248µsClass::MOP::Mixin::AttributeCore::::has_accessorClass::MOP::Mixin::AttributeCore::has_accessor
18711226µs226µsClass::MOP::Mixin::AttributeCore::::has_readerClass::MOP::Mixin::AttributeCore::has_reader
22911223µs223µsClass::MOP::Mixin::AttributeCore::::definition_contextClass::MOP::Mixin::AttributeCore::definition_context
18711220µs220µsClass::MOP::Mixin::AttributeCore::::has_clearerClass::MOP::Mixin::AttributeCore::has_clearer
18711212µs212µsClass::MOP::Mixin::AttributeCore::::has_predicateClass::MOP::Mixin::AttributeCore::has_predicate
18432207µs207µsClass::MOP::Mixin::AttributeCore::::has_builderClass::MOP::Mixin::AttributeCore::has_builder
15411182µs182µsClass::MOP::Mixin::AttributeCore::::readerClass::MOP::Mixin::AttributeCore::reader
11911142µs142µsClass::MOP::Mixin::AttributeCore::::_set_insertion_orderClass::MOP::Mixin::AttributeCore::_set_insertion_order
602273µs73µsClass::MOP::Mixin::AttributeCore::::has_initializerClass::MOP::Mixin::AttributeCore::has_initializer
361147µs47µsClass::MOP::Mixin::AttributeCore::::predicateClass::MOP::Mixin::AttributeCore::predicate
311145µs45µsClass::MOP::Mixin::AttributeCore::::accessorClass::MOP::Mixin::AttributeCore::accessor
11122µs32µsClass::MOP::Mixin::AttributeCore::::BEGIN@3Class::MOP::Mixin::AttributeCore::BEGIN@3
81113µs13µsClass::MOP::Mixin::AttributeCore::::writerClass::MOP::Mixin::AttributeCore::writer
11112µs37µsClass::MOP::Mixin::AttributeCore::::BEGIN@4Class::MOP::Mixin::AttributeCore::BEGIN@4
1119µs76µsClass::MOP::Mixin::AttributeCore::::BEGIN@10Class::MOP::Mixin::AttributeCore::BEGIN@10
0000s0sClass::MOP::Mixin::AttributeCore::::builderClass::MOP::Mixin::AttributeCore::builder
0000s0sClass::MOP::Mixin::AttributeCore::::clearerClass::MOP::Mixin::AttributeCore::clearer
0000s0sClass::MOP::Mixin::AttributeCore::::has_init_argClass::MOP::Mixin::AttributeCore::has_init_arg
0000s0sClass::MOP::Mixin::AttributeCore::::has_insertion_orderClass::MOP::Mixin::AttributeCore::has_insertion_order
0000s0sClass::MOP::Mixin::AttributeCore::::has_read_methodClass::MOP::Mixin::AttributeCore::has_read_method
0000s0sClass::MOP::Mixin::AttributeCore::::has_write_methodClass::MOP::Mixin::AttributeCore::has_write_method
0000s0sClass::MOP::Mixin::AttributeCore::::initializerClass::MOP::Mixin::AttributeCore::initializer
0000s0sClass::MOP::Mixin::AttributeCore::::insertion_orderClass::MOP::Mixin::AttributeCore::insertion_order
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Class::MOP::Mixin::AttributeCore;
2
3332µs241µs
# spent 32µs (22+9) within Class::MOP::Mixin::AttributeCore::BEGIN@3 which was called # once (22µs+9µs) by Class::MOP::BEGIN@15 at line 3
use strict;
# spent 32µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@3 # spent 9µs making 1 call to strict::import
4365µs262µs
# spent 37µs (12+25) within Class::MOP::Mixin::AttributeCore::BEGIN@4 which was called # once (12µs+25µs) by Class::MOP::BEGIN@15 at line 4
use warnings;
# spent 37µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@4 # spent 25µs making 1 call to warnings::import
5
61700nsour $VERSION = '0.98';
7119µs$VERSION = eval $VERSION;
81400nsour $AUTHORITY = 'cpan:STEVAN';
9
10329µs2143µs
# spent 76µs (9+67) within Class::MOP::Mixin::AttributeCore::BEGIN@10 which was called # once (9µs+67µs) by Class::MOP::BEGIN@15 at line 10
use Scalar::Util 'blessed';
# spent 76µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@10 # spent 67µs making 1 call to Exporter::import
11
123534µs22.87ms
# spent 2.04ms (1.13+914µs) within Class::MOP::Mixin::AttributeCore::BEGIN@12 which was called # once (1.13ms+914µs) by Class::MOP::BEGIN@15 at line 12
use base 'Class::MOP::Mixin';
# spent 2.04ms making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@12 # spent 831µs making 1 call to base::import
13
14187386µs
# spent 248µs within Class::MOP::Mixin::AttributeCore::has_accessor which was called 187 times, avg 1µs/call: # 187 times (248µs+0s) by Class::MOP::Attribute::install_accessors at line 354 of Class/MOP/Attribute.pm, avg 1µs/call
sub has_accessor { defined $_[0]->{'accessor'} }
15187343µs
# spent 226µs within Class::MOP::Mixin::AttributeCore::has_reader which was called 187 times, avg 1µs/call: # 187 times (226µs+0s) by Class::MOP::Attribute::install_accessors at line 358 of Class/MOP/Attribute.pm, avg 1µs/call
sub has_reader { defined $_[0]->{'reader'} }
16187385µs
# spent 269µs within Class::MOP::Mixin::AttributeCore::has_writer which was called 187 times, avg 1µs/call: # 187 times (269µs+0s) by Class::MOP::Attribute::install_accessors at line 362 of Class/MOP/Attribute.pm, avg 1µs/call
sub has_writer { defined $_[0]->{'writer'} }
17187348µs
# spent 212µs within Class::MOP::Mixin::AttributeCore::has_predicate which was called 187 times, avg 1µs/call: # 187 times (212µs+0s) by Class::MOP::Attribute::install_accessors at line 366 of Class/MOP/Attribute.pm, avg 1µs/call
sub has_predicate { defined $_[0]->{'predicate'} }
18187359µs
# spent 220µs within Class::MOP::Mixin::AttributeCore::has_clearer which was called 187 times, avg 1µs/call: # 187 times (220µs+0s) by Class::MOP::Attribute::install_accessors at line 370 of Class/MOP/Attribute.pm, avg 1µs/call
sub has_clearer { defined $_[0]->{'clearer'} }
19184332µs
# spent 207µs within Class::MOP::Mixin::AttributeCore::has_builder which was called 184 times, avg 1µs/call: # 180 times (202µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 136 of Class/MOP/Method/Constructor.pm, avg 1µs/call # 2 times (3µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 200 of Moose/Meta/Method/Constructor.pm, avg 2µs/call # 2 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 205 of Moose/Meta/Method/Constructor.pm, avg 900ns/call
sub has_builder { defined $_[0]->{'builder'} }
20sub has_init_arg { defined $_[0]->{'init_arg'} }
21275576µs
# spent 354µs within Class::MOP::Mixin::AttributeCore::has_default which was called 275 times, avg 1µs/call: # 267 times (345µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 136 of Class/MOP/Method/Constructor.pm, avg 1µs/call # 4 times (4µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 205 of Moose/Meta/Method/Constructor.pm, avg 1µs/call # 2 times (3µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 200 of Moose/Meta/Method/Constructor.pm, avg 1µs/call # 2 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 216 of Moose/Meta/Method/Constructor.pm, avg 1µs/call
sub has_default { defined $_[0]->{'default'} }
2260117µs
# spent 73µs within Class::MOP::Mixin::AttributeCore::has_initializer which was called 60 times, avg 1µs/call: # 54 times (67µs+0s) by Class::MOP::Attribute::_set_initial_slot_value at line 146 of Class/MOP/Attribute.pm, avg 1µs/call # 6 times (6µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_assignment at line 266 of Moose/Meta/Method/Constructor.pm, avg 1µs/call
sub has_initializer { defined $_[0]->{'initializer'} }
23sub has_insertion_order { defined $_[0]->{'insertion_order'} }
24
253163µs
# spent 45µs within Class::MOP::Mixin::AttributeCore::accessor which was called 31 times, avg 1µs/call: # 31 times (45µs+0s) by Class::MOP::Attribute::install_accessors at line 354 of Class/MOP/Attribute.pm, avg 1µs/call
sub accessor { $_[0]->{'accessor'} }
26154292µs
# spent 182µs within Class::MOP::Mixin::AttributeCore::reader which was called 154 times, avg 1µs/call: # 154 times (182µs+0s) by Class::MOP::Attribute::install_accessors at line 358 of Class/MOP/Attribute.pm, avg 1µs/call
sub reader { $_[0]->{'reader'} }
27823µs
# spent 13µs within Class::MOP::Mixin::AttributeCore::writer which was called 8 times, avg 2µs/call: # 8 times (13µs+0s) by Class::MOP::Attribute::install_accessors at line 362 of Class/MOP/Attribute.pm, avg 2µs/call
sub writer { $_[0]->{'writer'} }
283673µs
# spent 47µs within Class::MOP::Mixin::AttributeCore::predicate which was called 36 times, avg 1µs/call: # 36 times (47µs+0s) by Class::MOP::Attribute::install_accessors at line 366 of Class/MOP/Attribute.pm, avg 1µs/call
sub predicate { $_[0]->{'predicate'} }
29sub clearer { $_[0]->{'clearer'} }
30sub builder { $_[0]->{'builder'} }
31479921µs
# spent 575µs within Class::MOP::Mixin::AttributeCore::init_arg which was called 479 times, avg 1µs/call: # 267 times (318µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 159 of Class/MOP/Method/Constructor.pm, avg 1µs/call # 140 times (174µs+0s) by Moose::Meta::Attribute::new at line 58 of Moose/Meta/Attribute.pm, avg 1µs/call # 60 times (71µs+0s) by Class::MOP::Class::_clone_instance at line 422 of Class/MOP/Class.pm, avg 1µs/call # 6 times (6µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 200 of Moose/Meta/Method/Constructor.pm, avg 1µs/call # 2 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 231 of Moose/Meta/Method/Constructor.pm, avg 1µs/call # 2 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 205 of Moose/Meta/Method/Constructor.pm, avg 900ns/call # 2 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 207 of Moose/Meta/Method/Constructor.pm, avg 900ns/call
sub init_arg { $_[0]->{'init_arg'} }
32sub initializer { $_[0]->{'initializer'} }
33229404µs
# spent 223µs within Class::MOP::Mixin::AttributeCore::definition_context which was called 229 times, avg 976ns/call: # 229 times (223µs+0s) by Class::MOP::Attribute::_process_accessors at line 302 of Class/MOP/Attribute.pm, avg 976ns/call
sub definition_context { $_[0]->{'definition_context'} }
34sub insertion_order { $_[0]->{'insertion_order'} }
35119216µs
# spent 142µs within Class::MOP::Mixin::AttributeCore::_set_insertion_order which was called 119 times, avg 1µs/call: # 119 times (142µs+0s) by Class::MOP::Mixin::HasAttributes::add_attribute at line 36 of Class/MOP/Mixin/HasAttributes.pm, avg 1µs/call
sub _set_insertion_order { $_[0]->{'insertion_order'} = $_[1] }
36
37sub has_read_method { $_[0]->has_reader || $_[0]->has_accessor }
38sub has_write_method { $_[0]->has_writer || $_[0]->has_accessor }
39
40
# spent 350µs within Class::MOP::Mixin::AttributeCore::is_default_a_coderef which was called 149 times, avg 2µs/call: # 87 times (205µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 143 of Class/MOP/Method/Constructor.pm, avg 2µs/call # 32 times (60µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53, avg 2µs/call # 28 times (81µs+0s) by Class::MOP::Attribute::new at line 47 of Class/MOP/Attribute.pm, avg 3µs/call # 2 times (5µs+0s) by Moose::Meta::Method::Constructor::_generate_default_value at line 344 of Moose/Meta/Method/Constructor.pm, avg 2µs/call
sub is_default_a_coderef {
41 # Uber hack because it is called from CMOP::Attribute constructor as
42 # $class->is_default_a_coderef(\%options)
43149111µs my ($value) = ref $_[0] ? $_[0]->{'default'} : $_[1]->{'default'};
44
45149100µs return unless ref($value);
46
47108262µs return ref($value) eq 'CODE'
48 || ( blessed($value) && $value->isa('Class::MOP::Method') );
49}
50
51
# spent 15.1ms (446µs+14.6) within Class::MOP::Mixin::AttributeCore::default which was called 170 times, avg 89µs/call: # 58 times (101µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 145 of Class/MOP/Method/Constructor.pm, avg 2µs/call # 51 times (111µs+0s) by Class::MOP::Class::_immutable_metaclass at line 939 of Class/MOP/Class.pm, avg 2µs/call # 30 times (150µs+91µs) by Class::MOP::Attribute::initialize_instance_slot at line 113 of Class/MOP/Attribute.pm, avg 8µs/call # 29 times (61µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 149 of Class/MOP/Method/Constructor.pm, avg 2µs/call # once (11µs+8.99ms) by SimpleDB::Client::new at line 33 of generated method (unknown origin) # once (11µs+5.57ms) by SimpleDB::Client::new at line 23 of generated method (unknown origin)
sub default {
5217060µs my ( $self, $instance ) = @_;
53170126µs5214.6ms if ( defined $instance && $self->is_default_a_coderef ) {
# spent 8.99ms making 1 call to SimpleDB::Client::__ANON__[../lib/SimpleDB/Client.pm:133] # spent 5.56ms making 1 call to SimpleDB::Client::__ANON__[../lib/SimpleDB/Client.pm:120] # spent 60µs making 32 calls to Class::MOP::Mixin::AttributeCore::is_default_a_coderef, avg 2µs/call # spent 5µs making 2 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:34], avg 3µs/call # spent 5µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:321], avg 3µs/call # spent 5µs making 2 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:29], avg 2µs/call # spent 4µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:286], avg 2µs/call # spent 4µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:176], avg 2µs/call # spent 4µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:218], avg 2µs/call # spent 4µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:260], avg 2µs/call # spent 4µs making 2 calls to Class::MOP::__ANON__[Class/MOP.pm:305], avg 2µs/call # spent 2µs making 1 call to Class::MOP::__ANON__[Class/MOP.pm:494] # spent 2µs making 1 call to Moose::Meta::TypeConstraint::Registry::__ANON__[Moose/Meta/TypeConstraint/Registry.pm:24]
54 # if the default is a CODE ref, then we pass in the instance and
55 # default can return a value based on that instance. Somewhat crude,
56 # but works.
57 return $self->{'default'}->($instance);
58 }
59150307µs $self->{'default'};
60}
61
6214µs1;
63
64__END__
65
66=pod
67
68=head1 NAME
69
70Class::MOP::Mixin::AttributeCore - Core attributes shared by attribute metaclasses
71
72=head1 DESCRIPTION
73
74This class implements the core attributes (aka properties) shared by all
75attributes. See the L<Class::MOP::Attribute> documentation for API details.
76
77=head1 AUTHORS
78
79Dave Rolsky E<lt>autarch@urth.orgE<gt>
80
81=head1 COPYRIGHT AND LICENSE
82
83Copyright 2006-2010 by Infinity Interactive, Inc.
84
85L<http://www.iinteractive.com>
86
87This library is free software; you can redistribute it and/or modify
88it under the same terms as Perl itself.
89
90=cut
# spent 496µs within Class::MOP::Mixin::AttributeCore::name which was called 930 times, avg 533ns/call: # 343 times (169µs+0s) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 159 of Class/MOP/Method/Constructor.pm, avg 491ns/call # 295 times (152µs+0s) by Class::MOP::Attribute::slots at line 224 of Class/MOP/Attribute.pm, avg 514ns/call # 119 times (77µs+0s) by Class::MOP::Mixin::HasAttributes::add_attribute at line 30 of Class/MOP/Mixin/HasAttributes.pm, avg 646ns/call # 54 times (23µs+0s) by Class::MOP::Attribute::_set_initial_slot_value at line 144 of Class/MOP/Attribute.pm, avg 428ns/call # 52 times (36µs+0s) by Class::MOP::Method::Accessor::_generate_reader_method_inline at line 154 of Class/MOP/Method/Accessor.pm, avg 687ns/call # 15 times (9µs+0s) by Class::MOP::Method::Accessor::_generate_accessor_method_inline at line 135 of Class/MOP/Method/Accessor.pm, avg 627ns/call # 13 times (8µs+0s) by Class::MOP::Method::Accessor::_generate_predicate_method_inline at line 189 of Class/MOP/Method/Accessor.pm, avg 631ns/call # 12 times (7µs+0s) by Class::MOP::Attribute::set_raw_value at line 264 of Class/MOP/Attribute.pm, avg 575ns/call # 6 times (4µs+0s) by Class::MOP::Attribute::get_raw_value at line 272 of Class/MOP/Attribute.pm, avg 583ns/call # 6 times (3µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_assignment at line 272 of Moose/Meta/Method/Constructor.pm, avg 467ns/call # 4 times (3µs+0s) by Class::MOP::Attribute::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Class/MOP/Attribute.pm:340] at line 325 of Class/MOP/Attribute.pm, avg 675ns/call # 4 times (2µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 196 of Moose/Meta/Method/Constructor.pm, avg 600ns/call # 3 times (2µs+0s) by Class::MOP::Method::Accessor::_generate_writer_method_inline at line 172 of Class/MOP/Method/Accessor.pm, avg 633ns/call # 2 times (1µs+0s) by Class::MOP::Attribute::has_value at line 280 of Class/MOP/Attribute.pm, avg 700ns/call # 2 times (800ns+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 200 of Moose/Meta/Method/Constructor.pm, avg 400ns/call
sub Class::MOP::Mixin::AttributeCore::name; # xsub