← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:42 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Class/MOP/Mixin/AttributeCore.pm
StatementsExecuted 4479 statements in 8.26ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
474531.43ms4.79msClass::MOP::Mixin::AttributeCore::::defaultClass::MOP::Mixin::AttributeCore::default
26044700µs700µsClass::MOP::Mixin::AttributeCore::::is_default_a_coderefClass::MOP::Mixin::AttributeCore::is_default_a_coderef
1118µs8µsClass::MOP::Mixin::AttributeCore::::BEGIN@2Class::MOP::Mixin::AttributeCore::BEGIN@2
1117µs26µsClass::MOP::Mixin::AttributeCore::::BEGIN@12Class::MOP::Mixin::AttributeCore::BEGIN@12
1117µs297µsClass::MOP::Mixin::AttributeCore::::BEGIN@14Class::MOP::Mixin::AttributeCore::BEGIN@14
1116µs14µsClass::MOP::Mixin::AttributeCore::::BEGIN@10Class::MOP::Mixin::AttributeCore::BEGIN@10
1116µs8µsClass::MOP::Mixin::AttributeCore::::BEGIN@9Class::MOP::Mixin::AttributeCore::BEGIN@9
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
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
# spent 8µs within Class::MOP::Mixin::AttributeCore::BEGIN@2 which was called: # once (8µs+0s) by Class::MOP::BEGIN@23 at line 4
BEGIN {
314µs $Class::MOP::Mixin::AttributeCore::AUTHORITY = 'cpan:STEVAN';
4132µs18µs}
# spent 8µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@2
5{
621µs $Class::MOP::Mixin::AttributeCore::VERSION = '2.0602';
7}
8
9320µs210µs
# spent 8µs (6+2) within Class::MOP::Mixin::AttributeCore::BEGIN@9 which was called: # once (6µs+2µs) by Class::MOP::BEGIN@23 at line 9
use strict;
# spent 8µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@9 # spent 2µs making 1 call to strict::import
10317µs221µs
# spent 14µs (6+7) within Class::MOP::Mixin::AttributeCore::BEGIN@10 which was called: # once (6µs+7µs) by Class::MOP::BEGIN@23 at line 10
use warnings;
# spent 14µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@10 # spent 7µs making 1 call to warnings::import
11
12321µs245µs
# spent 26µs (7+19) within Class::MOP::Mixin::AttributeCore::BEGIN@12 which was called: # once (7µs+19µs) by Class::MOP::BEGIN@23 at line 12
use Scalar::Util 'blessed';
# spent 26µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@12 # spent 19µs making 1 call to Exporter::import
13
143292µs2587µs
# spent 297µs (7+290) within Class::MOP::Mixin::AttributeCore::BEGIN@14 which was called: # once (7µs+290µs) by Class::MOP::BEGIN@23 at line 14
use base 'Class::MOP::Mixin';
# spent 297µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@14 # spent 290µs making 1 call to base::import
15
16207478µssub has_accessor { defined $_[0]->{'accessor'} }
17207458µssub has_reader { defined $_[0]->{'reader'} }
18207432µssub has_writer { defined $_[0]->{'writer'} }
19207434µssub has_predicate { defined $_[0]->{'predicate'} }
20207424µssub has_clearer { defined $_[0]->{'clearer'} }
21193366µssub has_builder { defined $_[0]->{'builder'} }
22sub has_init_arg { defined $_[0]->{'init_arg'} }
23304634µssub has_default { exists $_[0]->{'default'} }
247571.80mssub has_initializer { defined $_[0]->{'initializer'} }
25sub has_insertion_order { defined $_[0]->{'insertion_order'} }
26
27133300µssub _set_insertion_order { $_[0]->{'insertion_order'} = $_[1] }
28
29sub has_read_method { $_[0]->has_reader || $_[0]->has_accessor }
30sub has_write_method { $_[0]->has_writer || $_[0]->has_accessor }
31
32
# spent 700µs within Class::MOP::Mixin::AttributeCore::is_default_a_coderef which was called 260 times, avg 3µs/call: # 131 times (352µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 45, avg 3µs/call # 96 times (231µs+0s) by Class::MOP::Class::_inline_default_value at line 667 of Class/MOP/Class.pm, avg 2µs/call # 32 times (112µs+0s) by Class::MOP::Attribute::new at line 49 of Class/MOP/Attribute.pm, avg 4µs/call # once (5µs+0s) by Moose::Meta::Attribute::_inline_generate_default at line 929 of Moose/Meta/Attribute.pm
sub is_default_a_coderef {
33 # Uber hack because it is called from CMOP::Attribute constructor as
34 # $class->is_default_a_coderef(\%options)
356961.00ms my ($value) = ref $_[0] ? $_[0]->{'default'} : $_[1]->{'default'};
36
37 return unless ref($value);
38
39 return ref($value) eq 'CODE'
40 || ( blessed($value) && $value->isa('Class::MOP::Method') );
41}
42
43
# spent 4.79ms (1.43+3.35) within Class::MOP::Mixin::AttributeCore::default which was called 474 times, avg 10µs/call: # 286 times (391µs+0s) by Class::MOP::Class::_eval_environment at line 710 of Class/MOP/Class.pm, avg 1µs/call # 128 times (861µs+520µs) by Class::MOP::Attribute::initialize_instance_slot at line 117 of Class/MOP/Attribute.pm, avg 11µs/call # 52 times (133µs+0s) by Class::MOP::Class::_immutable_metaclass at line 1335 of Class/MOP/Class.pm, avg 3µs/call # 5 times (15µs+0s) by Moose::Meta::Attribute::_eval_environment at line 779 of Moose/Meta/Attribute.pm, avg 3µs/call # 3 times (32µs+2.83ms) by Moose::Meta::Attribute::initialize_instance_slot at line 520 of Moose/Meta/Attribute.pm, avg 955µs/call
sub default {
4413451.54ms my ( $self, $instance ) = @_;
452083.35ms if ( defined $instance && $self->is_default_a_coderef ) {
# spent 2.57ms making 1 call to Tapper::MCP::Scheduler::Algorithm::__ANON__[lib/Tapper/MCP/Scheduler/Algorithm.pm:12] # spent 352µs making 131 calls to Class::MOP::Mixin::AttributeCore::is_default_a_coderef, avg 3µs/call # spent 249µs making 1 call to Tapper::MCP::Scheduler::Controller::__ANON__[lib/Tapper/MCP/Scheduler/Controller.pm:14] # spent 32µs making 9 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:37], avg 4µs/call # spent 23µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:286], avg 3µs/call # spent 23µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:132], avg 3µs/call # spent 21µs making 9 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:43], avg 2µs/call # spent 20µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:177], avg 2µs/call # spent 20µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:222], avg 2µs/call # spent 20µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:249], avg 2µs/call # spent 16µs making 9 calls to Class::MOP::__ANON__[Class/MOP.pm:269], avg 2µs/call # spent 2µs making 1 call to Moose::Meta::TypeConstraint::Registry::__ANON__[Moose/Meta/TypeConstraint/Registry.pm:27] # spent 2µs making 1 call to Class::MOP::__ANON__[Class/MOP.pm:478] # spent 2µs making 1 call to Tapper::MCP::Scheduler::Controller::__ANON__[lib/Tapper/MCP/Scheduler/Controller.pm:26]
46 # if the default is a CODE ref, then we pass in the instance and
47 # default can return a value based on that instance. Somewhat crude,
48 # but works.
49 return $self->{'default'}->($instance);
50 }
51 $self->{'default'};
52}
53
5412µs1;
55
56# ABSTRACT: Core attributes shared by attribute metaclasses
57
- -
60=pod
61
62=head1 NAME
63
64Class::MOP::Mixin::AttributeCore - Core attributes shared by attribute metaclasses
65
66=head1 VERSION
67
68version 2.0602
69
70=head1 DESCRIPTION
71
72This class implements the core attributes (aka properties) shared by all
73attributes. See the L<Class::MOP::Attribute> documentation for API details.
74
75=head1 AUTHOR
76
77Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details.
78
79=head1 COPYRIGHT AND LICENSE
80
81This software is copyright (c) 2012 by Infinity Interactive, Inc..
82
83This is free software; you can redistribute it and/or modify it under
84the same terms as the Perl 5 programming language system itself.
85
86=cut
87
88
89__END__