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

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Class/MOP/MiniTrait.pm
StatementsExecuted 198 statements in 837µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
777606µs20.5msClass::MOP::MiniTrait::::applyClass::MOP::MiniTrait::apply
1118µs8µsClass::MOP::MiniTrait::::BEGIN@2Class::MOP::MiniTrait::BEGIN@2
1117µs31µsClass::MOP::MiniTrait::::BEGIN@12Class::MOP::MiniTrait::BEGIN@12
1117µs9µsClass::MOP::MiniTrait::::BEGIN@9Class::MOP::MiniTrait::BEGIN@9
1116µs17µsClass::MOP::MiniTrait::::BEGIN@10Class::MOP::MiniTrait::BEGIN@10
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::MiniTrait;
2
# spent 8µs within Class::MOP::MiniTrait::BEGIN@2 which was called: # once (8µs+0s) by Class::MOP::Class::BEGIN@17 at line 4
BEGIN {
315µs $Class::MOP::MiniTrait::AUTHORITY = 'cpan:STEVAN';
4121µs18µs}
# spent 8µs making 1 call to Class::MOP::MiniTrait::BEGIN@2
5{
62900ns $Class::MOP::MiniTrait::VERSION = '2.0602';
7}
8
9316µs212µs
# spent 9µs (7+3) within Class::MOP::MiniTrait::BEGIN@9 which was called: # once (7µs+3µs) by Class::MOP::Class::BEGIN@17 at line 9
use strict;
# spent 9µs making 1 call to Class::MOP::MiniTrait::BEGIN@9 # spent 3µs making 1 call to strict::import
10319µs227µs
# spent 17µs (6+10) within Class::MOP::MiniTrait::BEGIN@10 which was called: # once (6µs+10µs) by Class::MOP::Class::BEGIN@17 at line 10
use warnings;
# spent 17µs making 1 call to Class::MOP::MiniTrait::BEGIN@10 # spent 10µs making 1 call to warnings::import
11
123133µs255µs
# spent 31µs (7+24) within Class::MOP::MiniTrait::BEGIN@12 which was called: # once (7µs+24µs) by Class::MOP::Class::BEGIN@17 at line 12
use Class::Load qw(load_class);
# spent 31µs making 1 call to Class::MOP::MiniTrait::BEGIN@12 # spent 24µs making 1 call to Exporter::import
13
14
# spent 20.5ms (606µs+19.9) within Class::MOP::MiniTrait::apply which was called 7 times, avg 2.93ms/call: # once (244µs+11.0ms) by Class::MOP::Class::_immutable_metaclass at line 1359 of Class/MOP/Class.pm # once (59µs+1.99ms) by base::import at line 16 of Moose/Meta/Method.pm # once (66µs+1.66ms) by Moose::Meta::TypeCoercion::BEGIN@14 at line 29 of Moose/Meta/Attribute.pm # once (62µs+1.62ms) by Moose::BEGIN@28 at line 33 of Moose/Meta/Class.pm # once (55µs+1.27ms) by Moose::BEGIN@32 at line 17 of Moose/Meta/Instance.pm # once (66µs+1.25ms) by Moose::BEGIN@36 at line 31 of Moose/Meta/Role.pm # once (54µs+1.06ms) by Moose::Meta::Class::BEGIN@23 at line 19 of Moose/Error/Default.pm
sub apply {
1521109µs my ( $to_class, $trait ) = @_;
16
17 for ( grep { !ref } $to_class, $trait ) {
182670µs131.89ms load_class($_);
# spent 1.89ms making 13 calls to Class::Load::load_class, avg 146µs/call
19132.31ms $_ = Class::MOP::Class->initialize($_);
# spent 2.31ms making 13 calls to Class::MOP::Class::initialize, avg 178µs/call
20 }
21
2261150µs682.80ms for my $meth ( grep { $_->package_name ne 'UNIVERSAL' } $trait->get_all_methods ) {
# spent 2.77ms making 7 calls to Class::MOP::Class::get_all_methods, avg 396µs/call # spent 31µs making 61 calls to Class::MOP::Method::package_name, avg 503ns/call
2366276µs3319µs my $meth_name = $meth->name;
# spent 19µs making 33 calls to Class::MOP::Method::name, avg 582ns/call
24
251034µs7912.0ms if ( $to_class->find_method_by_name($meth_name) ) {
# spent 6.19ms making 23 calls to Class::MOP::Class::add_around_method_modifier, avg 269µs/call # spent 5.76ms making 33 calls to Class::MOP::Class::find_method_by_name, avg 175µs/call # spent 16µs making 23 calls to Class::MOP::Method::body, avg 683ns/call
26 $to_class->add_around_method_modifier( $meth_name, $meth->body );
27 }
28 else {
2920892µs $to_class->add_method( $meth_name, $meth->clone );
# spent 678µs making 10 calls to Class::MOP::Mixin::HasMethods::add_method, avg 68µs/call # spent 214µs making 10 calls to Class::MOP::Method::clone, avg 21µs/call
30 }
31 }
32}
33
34# We can't load this with use, since it may be loaded and used from Class::MOP
35# (via CMOP::Class, etc). However, if for some reason this module is loaded
36# _without_ first loading Class::MOP we need to require Class::MOP so we can
37# use it and CMOP::Class.
381600nsrequire Class::MOP;
39
4012µs1;
41
42# ABSTRACT: Extremely limited trait application
43
- -
46=pod
47
48=head1 NAME
49
50Class::MOP::MiniTrait - Extremely limited trait application
51
52=head1 VERSION
53
54version 2.0602
55
56=head1 DESCRIPTION
57
58This package provides a single function, C<apply>, which does a half-assed job
59of applying a trait to a class. It exists solely for use inside Class::MOP and
60L<Moose> core classes.
61
62=head1 AUTHOR
63
64Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details.
65
66=head1 COPYRIGHT AND LICENSE
67
68This software is copyright (c) 2012 by Infinity Interactive, Inc..
69
70This is free software; you can redistribute it and/or modify it under
71the same terms as the Perl 5 programming language system itself.
72
73=cut
74
75
76__END__