Profile of /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/Role/Application/ToInstance.pm

← 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/Moose/Meta/Role/Application/ToInstance.pm
Statements Executed | 20
Statement Execution Time | 279µs

Subroutines — ordered by exclusive time
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 15µs | 18µs | Moose::Meta::Role::Application::ToInstance::::BEGIN@3Moose::Meta::Role::Application::ToInstance::BEGIN@3
1 | 1 | 1 | 7µs | 16µs | Moose::Meta::Role::Application::ToInstance::::BEGIN@4Moose::Meta::Role::Application::ToInstance::BEGIN@4
1 | 1 | 1 | 7µs | 50µs | Moose::Meta::Role::Application::ToInstance::::BEGIN@13Moose::Meta::Role::Application::ToInstance::BEGIN@13
1 | 1 | 1 | 7µs | 31µs | Moose::Meta::Role::Application::ToInstance::::BEGIN@7Moose::Meta::Role::Application::ToInstance::BEGIN@7
1 | 1 | 1 | 5µs | 101µs | Moose::Meta::Role::Application::ToInstance::::BEGIN@5Moose::Meta::Role::Application::ToInstance::BEGIN@5
0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::ToInstance::::__ANON__[:17]Moose::Meta::Role::Application::ToInstance::__ANON__[:17]
0 | 0 | 0 | 0s | 0s | Moose::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
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Moose::Meta::Role::Application::ToInstance;
2 |  |  |  |  |
3 | 3 | 21µs | 2 | 21µs | # spent 18µs (15+3) within Moose::Meta::Role::Application::ToInstance::BEGIN@3 which was called # once (15µs+3µs) by Moose::BEGIN@32 at line 3 use strict; # spent 18µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@3 # spent 3µs making 1 call to strict::import
4 | 3 | 19µs | 2 | 25µs | # spent 16µs (7+9) within Moose::Meta::Role::Application::ToInstance::BEGIN@4 which was called # once (7µs+9µs) by Moose::BEGIN@32 at line 4 use warnings; # spent 16µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@4 # spent 9µs making 1 call to warnings::import
5 | 3 | 25µs | 2 | 196µs | # spent 101µs (5+95) within Moose::Meta::Role::Application::ToInstance::BEGIN@5 which was called # once (5µs+95µs) by Moose::BEGIN@32 at line 5 use metaclass; # spent 101µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@5 # spent 95µs making 1 call to metaclass::import
6 |  |  |  |  |
7 | 3 | 52µs | 2 | 55µs | # spent 31µs (7+24) within Moose::Meta::Role::Application::ToInstance::BEGIN@7 which was called # once (7µs+24µs) by Moose::BEGIN@32 at line 7 use Scalar::Util 'blessed'; # spent 31µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@7 # spent 24µs making 1 call to Exporter::import
8 |  |  |  |  |
9 | 1 | 700ns |  |  | our $VERSION = '0.98';
10 | 1 | 14µs |  |  | $VERSION = eval $VERSION;
11 | 1 | 300ns |  |  | our $AUTHORITY = 'cpan:STEVAN';
12 |  |  |  |  |
13 | 3 | 127µs | 2 | 92µs | # spent 50µs (7+43) within Moose::Meta::Role::Application::ToInstance::BEGIN@13 which was called # once (7µs+43µs) by Moose::BEGIN@32 at line 13 use base 'Moose::Meta::Role::Application::ToClass'; # spent 50µs making 1 call to Moose::Meta::Role::Application::ToInstance::BEGIN@13 # spent 42µs making 1 call to base::import
14 |  |  |  |  |
15 |  |  |  |  | __PACKAGE__->meta->add_attribute('rebless_params' => (
16 |  |  |  |  | reader => 'rebless_params',
17 |  |  |  |  | default => sub { {} }
18 | 1 | 4µs | 2 | 305µs | )); # spent 287µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 18µs making 1 call to Moose::Meta::Role::Application::ToInstance::meta
19 |  |  |  |  |
20 |  |  |  |  | sub apply {
21 |  |  |  |  | my ( $self, $role, $object ) = @_;
22 |  |  |  |  |
23 |  |  |  |  | my $obj_meta = Class::MOP::class_of($object) || 'Moose::Meta::Class';
24 |  |  |  |  |
25 |  |  |  |  | # This is a special case to handle the case where the object's metaclass
26 |  |  |  |  | # is a Class::MOP::Class, but _not_ a Moose::Meta::Class (for example,
27 |  |  |  |  | # when applying a role to a Moose::Meta::Attribute object).
28 |  |  |  |  | $obj_meta = 'Moose::Meta::Class'
29 |  |  |  |  | unless $obj_meta->isa('Moose::Meta::Class');
30 |  |  |  |  |
31 |  |  |  |  | my $class = $obj_meta->create_anon_class(
32 |  |  |  |  | superclasses => [ blessed($object) ],
33 |  |  |  |  | roles => [ $role ],
34 |  |  |  |  | cache => 1,
35 |  |  |  |  | );
36 |  |  |  |  |
37 |  |  |  |  | $class->rebless_instance( $object, %{ $self->rebless_params } );
38 |  |  |  |  | }
39 |  |  |  |  |
40 | 1 | 15µs |  |  | 1;
41 |  |  |  |  |
42 |  |  |  |  | __END__
43 |  |  |  |  |
44 |  |  |  |  | =pod
45 |  |  |  |  |
46 |  |  |  |  | =head1 NAME
47 |  |  |  |  |
48 |  |  |  |  | Moose::Meta::Role::Application::ToInstance - Compose a role into an instance
49 |  |  |  |  |
50 |  |  |  |  | =head1 DESCRIPTION
51 |  |  |  |  |
52 |  |  |  |  | =head2 METHODS
53 |  |  |  |  |
54 |  |  |  |  | =over 4
55 |  |  |  |  |
56 |  |  |  |  | =item B<new>
57 |  |  |  |  |
58 |  |  |  |  | =item B<meta>
59 |  |  |  |  |
60 |  |  |  |  | =item B<apply>
61 |  |  |  |  |
62 |  |  |  |  | =item B<rebless_params>
63 |  |  |  |  |
64 |  |  |  |  | =back
65 |  |  |  |  |
66 |  |  |  |  | =head1 BUGS
67 |  |  |  |  |
68 |  |  |  |  | See L<Moose/BUGS> for details on reporting bugs.
69 |  |  |  |  |
70 |  |  |  |  | =head1 AUTHOR
71 |  |  |  |  |
72 |  |  |  |  | Stevan Little E<lt>stevan@iinteractive.comE<gt>
73 |  |  |  |  |
74 |  |  |  |  | =head1 COPYRIGHT AND LICENSE
75 |  |  |  |  |
76 |  |  |  |  | Copyright 2006-2010 by Infinity Interactive, Inc.
77 |  |  |  |  |
78 |  |  |  |  | L<http://www.iinteractive.com>
79 |  |  |  |  |
80 |  |  |  |  | This library is free software; you can redistribute it and/or modify
81 |  |  |  |  | it under the same terms as Perl itself.
82 |  |  |  |  |
83 |  |  |  |  | =cut
84 |  |  |  |  |