← 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:23:29 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Class/MOP/Module.pm
StatementsExecuted 49 statements in 493µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
21191µs2.22msClass::MOP::Module::::createClass::MOP::Module::create
21120µs22µsClass::MOP::Module::::_instantiate_moduleClass::MOP::Module::_instantiate_module
11110µs5.87msClass::MOP::Module::::BEGIN@16Class::MOP::Module::BEGIN@16
11110µs10µsClass::MOP::Module::::BEGIN@3Class::MOP::Module::BEGIN@3
1116µs9µsClass::MOP::Module::::BEGIN@10Class::MOP::Module::BEGIN@10
1116µs14µsClass::MOP::Module::::BEGIN@11Class::MOP::Module::BEGIN@11
1116µs27µsClass::MOP::Module::::BEGIN@13Class::MOP::Module::BEGIN@13
1116µs28µsClass::MOP::Module::::BEGIN@14Class::MOP::Module::BEGIN@14
0000s0sClass::MOP::Module::::_anon_cache_keyClass::MOP::Module::_anon_cache_key
0000s0sClass::MOP::Module::::_anon_package_prefixClass::MOP::Module::_anon_package_prefix
0000s0sClass::MOP::Module::::_newClass::MOP::Module::_new
0000s0sClass::MOP::Module::::identifierClass::MOP::Module::identifier
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2package Class::MOP::Module;
3
# spent 10µs within Class::MOP::Module::BEGIN@3 which was called: # once (10µs+0s) by base::import at line 5
BEGIN {
415µs $Class::MOP::Module::AUTHORITY = 'cpan:STEVAN';
5123µs110µs}
# spent 10µs making 1 call to Class::MOP::Module::BEGIN@3
6{
721µs $Class::MOP::Module::VERSION = '2.0602';
8}
9
10316µs211µs
# spent 9µs (6+2) within Class::MOP::Module::BEGIN@10 which was called: # once (6µs+2µs) by base::import at line 10
use strict;
# spent 9µs making 1 call to Class::MOP::Module::BEGIN@10 # spent 2µs making 1 call to strict::import
11317µs222µs
# spent 14µs (6+8) within Class::MOP::Module::BEGIN@11 which was called: # once (6µs+8µs) by base::import at line 11
use warnings;
# spent 14µs making 1 call to Class::MOP::Module::BEGIN@11 # spent 8µs making 1 call to warnings::import
12
13317µs249µs
# spent 27µs (6+22) within Class::MOP::Module::BEGIN@13 which was called: # once (6µs+22µs) by base::import at line 13
use Carp 'confess';
# spent 27µs making 1 call to Class::MOP::Module::BEGIN@13 # spent 22µs making 1 call to Exporter::import
14317µs250µs
# spent 28µs (6+22) within Class::MOP::Module::BEGIN@14 which was called: # once (6µs+22µs) by base::import at line 14
use Scalar::Util 'blessed';
# spent 28µs making 1 call to Class::MOP::Module::BEGIN@14 # spent 22µs making 1 call to Exporter::import
15
163284µs25.87ms
# spent 5.87ms (10µs+5.86) within Class::MOP::Module::BEGIN@16 which was called: # once (10µs+5.86ms) by base::import at line 16
use base 'Class::MOP::Package';
# spent 5.87ms making 1 call to Class::MOP::Module::BEGIN@16 # spent 5.86ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 5.86ms
17
18sub _new {
19 my $class = shift;
20 return Class::MOP::Class->initialize($class)->new_object(@_)
21 if $class ne __PACKAGE__;
22
23 my $params = @_ == 1 ? $_[0] : {@_};
24 return bless {
25 # Need to quote package to avoid a problem with PPI mis-parsing this
26 # as a package statement.
27
28 # from Class::MOP::Package
29 'package' => $params->{package},
30 namespace => \undef,
31
32 # attributes
33 version => \undef,
34 authority => \undef
35 } => $class;
36}
37
38sub version {
39 my $self = shift;
40 ${$self->get_or_add_package_symbol('$VERSION')};
41}
42
43sub authority {
44 my $self = shift;
45 ${$self->get_or_add_package_symbol('$AUTHORITY')};
46}
47
48sub identifier {
49 my $self = shift;
50 join '-' => (
51 $self->name,
52 ($self->version || ()),
53 ($self->authority || ()),
54 );
55}
56
57
# spent 2.22ms (91µs+2.12) within Class::MOP::Module::create which was called 2 times, avg 1.11ms/call: # 2 times (91µs+2.12ms) by Class::MOP::Class::create at line 446 of Class/MOP/Class.pm, avg 1.11ms/call
sub create {
5822µs my $class = shift;
5926µs my @args = @_;
60
6124µs unshift @args, 'package' if @args % 2 == 1;
6224µs my %options = @args;
63
6424µs my $package = delete $options{package};
6522µs my $version = delete $options{version};
6621µs my $authority = delete $options{authority};
67
68230µs22.10ms my $meta = $class->SUPER::create($package => %options);
# spent 2.10ms making 2 calls to Class::MOP::Package::create, avg 1.05ms/call
69
70221µs222µs $meta->_instantiate_module($version, $authority);
# spent 22µs making 2 calls to Class::MOP::Module::_instantiate_module, avg 11µs/call
71
72212µs return $meta;
73}
74
75sub _anon_package_prefix { 'Class::MOP::Module::__ANON__::SERIAL::' }
76sub _anon_cache_key { confess "Modules are not cacheable" }
77
78
79
# spent 22µs (20+2) within Class::MOP::Module::_instantiate_module which was called 2 times, avg 11µs/call: # 2 times (20µs+2µs) by Class::MOP::Module::create at line 70, avg 11µs/call
sub _instantiate_module {
8022µs my($self, $version, $authority) = @_;
81212µs22µs my $package_name = $self->name;
# spent 2µs making 2 calls to Class::MOP::Package::name, avg 1µs/call
82
8321µs $self->add_package_symbol('$VERSION' => $version)
84 if defined $version;
852800ns $self->add_package_symbol('$AUTHORITY' => $authority)
86 if defined $authority;
87
8829µs return;
89}
90
9113µs1;
92
93# ABSTRACT: Module Meta Object
94
- -
97=pod
98
99=head1 NAME
100
101Class::MOP::Module - Module Meta Object
102
103=head1 VERSION
104
105version 2.0602
106
107=head1 DESCRIPTION
108
109A module is essentially a L<Class::MOP::Package> with metadata, in our
110case the version and authority.
111
112=head1 INHERITANCE
113
114B<Class::MOP::Module> is a subclass of L<Class::MOP::Package>.
115
116=head1 METHODS
117
118=over 4
119
120=item B<< Class::MOP::Module->create($package, %options) >>
121
122Overrides C<create> from L<Class::MOP::Package> to provide these additional
123options:
124
125=over 4
126
127=item C<version>
128
129A version number, to be installed in the C<$VERSION> package global variable.
130
131=item C<authority>
132
133An authority, to be installed in the C<$AUTHORITY> package global variable.
134
135=back
136
137=item B<< $metamodule->version >>
138
139This is a read-only attribute which returns the C<$VERSION> of the
140package, if one exists.
141
142=item B<< $metamodule->authority >>
143
144This is a read-only attribute which returns the C<$AUTHORITY> of the
145package, if one exists.
146
147=item B<< $metamodule->identifier >>
148
149This constructs a string which combines the name, version and
150authority.
151
152=item B<< Class::MOP::Module->meta >>
153
154This will return a L<Class::MOP::Class> instance for this class.
155
156=back
157
158=head1 AUTHOR
159
160Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details.
161
162=head1 COPYRIGHT AND LICENSE
163
164This software is copyright (c) 2012 by Infinity Interactive, Inc..
165
166This is free software; you can redistribute it and/or modify it under
167the same terms as the Perl 5 programming language system itself.
168
169=cut
170
171
172__END__