← 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:35 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Moose/Meta/Role/Application/ToInstance.pm
StatementsExecuted 23 statements in 329µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1119µs9µsMoose::Meta::Role::Application::ToInstance::::BEGIN@2Moose::Meta::Role::Application::ToInstance::BEGIN@2
1119µs14µsMoose::Meta::Role::Application::ToInstance::::BEGIN@9Moose::Meta::Role::Application::ToInstance::BEGIN@9
1119µs44µsMoose::Meta::Role::Application::ToInstance::::BEGIN@13Moose::Meta::Role::Application::ToInstance::BEGIN@13
1118µs566µsMoose::Meta::Role::Application::ToInstance::::BEGIN@11Moose::Meta::Role::Application::ToInstance::BEGIN@11
1118µs24µsMoose::Meta::Role::Application::ToInstance::::BEGIN@10Moose::Meta::Role::Application::ToInstance::BEGIN@10
1118µs34µsMoose::Meta::Role::Application::ToInstance::::BEGIN@14Moose::Meta::Role::Application::ToInstance::BEGIN@14
1118µs77µsMoose::Meta::Role::Application::ToInstance::::BEGIN@16Moose::Meta::Role::Application::ToInstance::BEGIN@16
0000s0sMoose::Meta::Role::Application::ToInstance::::__ANON__[:20]Moose::Meta::Role::Application::ToInstance::__ANON__[:20]
0000s0sMoose::Meta::Role::Application::ToInstance::::__ANON__[:38]Moose::Meta::Role::Application::ToInstance::__ANON__[:38]
0000s0sMoose::Meta::Role::Application::ToInstance::::applyMoose::Meta::Role::Application::ToInstance::apply
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Meta::Role::Application::ToInstance;
2
# spent 9µs within Moose::Meta::Role::Application::ToInstance::BEGIN@2 which was called: # once (9µs+0s) by Moose::BEGIN@42 at line 4
BEGIN {
315µs $Moose::Meta::Role::Application::ToInstance::AUTHORITY = 'cpan:STEVAN';
4125µs19µs}
5{
621µs $Moose::Meta::Role::Application::ToInstance::VERSION = '2.0602';
7}
8
9319µs219µs
# spent 14µs (9+5) within Moose::Meta::Role::Application::ToInstance::BEGIN@9 which was called: # once (9µs+5µs) by Moose::BEGIN@42 at line 9
use strict;
# spent 14µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@9 # spent 5µs making 1 call to strict::import
10318µs240µs
# spent 24µs (8+16) within Moose::Meta::Role::Application::ToInstance::BEGIN@10 which was called: # once (8µs+16µs) by Moose::BEGIN@42 at line 10
use warnings;
# spent 24µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@10 # spent 16µs making 1 call to warnings::import
11328µs21.12ms
# spent 566µs (8+557) within Moose::Meta::Role::Application::ToInstance::BEGIN@11 which was called: # once (8µs+557µs) by Moose::BEGIN@42 at line 11
use metaclass;
# spent 566µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@11 # spent 557µs making 1 call to metaclass::import
12
13321µs280µs
# spent 44µs (9+36) within Moose::Meta::Role::Application::ToInstance::BEGIN@13 which was called: # once (9µs+36µs) by Moose::BEGIN@42 at line 13
use Scalar::Util 'blessed';
# spent 44µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@13 # spent 35µs making 1 call to Exporter::import
14320µs261µs
# spent 34µs (8+27) within Moose::Meta::Role::Application::ToInstance::BEGIN@14 which was called: # once (8µs+27µs) by Moose::BEGIN@42 at line 14
use List::MoreUtils 'all';
# spent 34µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@14 # spent 27µs making 1 call to Exporter::import
15
163180µs2146µs
# spent 77µs (8+69) within Moose::Meta::Role::Application::ToInstance::BEGIN@16 which was called: # once (8µs+69µs) by Moose::BEGIN@42 at line 16
use base 'Moose::Meta::Role::Application';
# spent 77µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@16 # spent 69µs making 1 call to base::import
17
18__PACKAGE__->meta->add_attribute('rebless_params' => (
19 reader => 'rebless_params',
20 default => sub { {} },
2117µs3478µs Class::MOP::_definition_context(),
# spent 453µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 16µs making 1 call to Moose::Meta::Role::Application::ToInstance::meta # spent 9µs making 1 call to Class::MOP::_definition_context
22));
23
24sub apply {
25 my ( $self, $role, $object, $args ) = @_;
26
27 my $obj_meta = Class::MOP::class_of($object) || 'Moose::Meta::Class';
28
29 # This is a special case to handle the case where the object's metaclass
30 # is a Class::MOP::Class, but _not_ a Moose::Meta::Class (for example,
31 # when applying a role to a Moose::Meta::Attribute object).
32 $obj_meta = 'Moose::Meta::Class'
33 unless $obj_meta->isa('Moose::Meta::Class');
34
35 my $class = $obj_meta->create_anon_class(
36 superclasses => [ blessed($object) ],
37 roles => [ $role, keys(%$args) ? ($args) : () ],
38 cache => (all { $_ eq '-alias' || $_ eq '-excludes' } keys %$args),
39 );
40
41 $class->rebless_instance( $object, %{ $self->rebless_params } );
42}
43
4416µs1;
45
46# ABSTRACT: Compose a role into an instance
47
- -
50=pod
51
52=head1 NAME
53
54Moose::Meta::Role::Application::ToInstance - Compose a role into an instance
55
56=head1 VERSION
57
58version 2.0602
59
60=head1 DESCRIPTION
61
62=head2 METHODS
63
64=over 4
65
66=item B<new>
67
68=item B<meta>
69
70=item B<apply>
71
72=item B<rebless_params>
73
74=back
75
76=head1 BUGS
77
78See L<Moose/BUGS> for details on reporting bugs.
79
80=head1 AUTHOR
81
82Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details.
83
84=head1 COPYRIGHT AND LICENSE
85
86This software is copyright (c) 2012 by Infinity Interactive, Inc..
87
88This is free software; you can redistribute it and/or modify it under
89the same terms as the Perl 5 programming language system itself.
90
91=cut
92
93
94__END__