← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 09:58:41 2014
Reported on Tue Jun 24 09:59:33 2014

Filename/usr/local/lib/perl/5.14.2/Class/MOP/Module.pm
StatementsExecuted 44 statements in 486µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
21136µs214µsClass::MOP::Module::::createClass::MOP::Module::create
2119µs10µsClass::MOP::Module::::_instantiate_moduleClass::MOP::Module::_instantiate_module
1118µs8µsClass::MOP::Module::::BEGIN@3Class::MOP::Module::BEGIN@3
1117µs33µsClass::MOP::Module::::BEGIN@14Class::MOP::Module::BEGIN@14
1117µs10µsClass::MOP::Module::::BEGIN@10Class::MOP::Module::BEGIN@10
1117µs3.75msClass::MOP::Module::::BEGIN@16Class::MOP::Module::BEGIN@16
1116µs38µsClass::MOP::Module::::BEGIN@13Class::MOP::Module::BEGIN@13
1116µs11µsClass::MOP::Module::::BEGIN@11Class::MOP::Module::BEGIN@11
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 8µs within Class::MOP::Module::BEGIN@3 which was called: # once (8µs+0s) by base::import at line 5
BEGIN {
4113µs $Class::MOP::Module::AUTHORITY = 'cpan:STEVAN';
5130µs18µs}
# spent 8µs making 1 call to Class::MOP::Module::BEGIN@3
6{
721µs $Class::MOP::Module::VERSION = '2.1005';
8}
9
10220µs213µs
# spent 10µs (7+3) within Class::MOP::Module::BEGIN@10 which was called: # once (7µs+3µs) by base::import at line 10
use strict;
# spent 10µs making 1 call to Class::MOP::Module::BEGIN@10 # spent 3µs making 1 call to strict::import
11224µs216µs
# spent 11µs (6+5) within Class::MOP::Module::BEGIN@11 which was called: # once (6µs+5µs) by base::import at line 11
use warnings;
# spent 11µs making 1 call to Class::MOP::Module::BEGIN@11 # spent 5µs making 1 call to warnings::import
12
13234µs269µs
# spent 38µs (6+31) within Class::MOP::Module::BEGIN@13 which was called: # once (6µs+31µs) by base::import at line 13
use Carp 'confess';
# spent 38µs making 1 call to Class::MOP::Module::BEGIN@13 # spent 31µs making 1 call to Exporter::import
14226µs259µs
# spent 33µs (7+26) within Class::MOP::Module::BEGIN@14 which was called: # once (7µs+26µs) by base::import at line 14
use Scalar::Util 'blessed';
# spent 33µs making 1 call to Class::MOP::Module::BEGIN@14 # spent 26µs making 1 call to Exporter::import
15
162291µs23.75ms
# spent 3.75ms (7µs+3.74) within Class::MOP::Module::BEGIN@16 which was called: # once (7µs+3.74ms) by base::import at line 16
use base 'Class::MOP::Package';
# spent 3.75ms making 1 call to Class::MOP::Module::BEGIN@16 # spent 3.74ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 3.74ms
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 214µs (36+178) within Class::MOP::Module::create which was called 2 times, avg 107µs/call: # 2 times (36µs+178µs) by Class::MOP::Class::create at line 446 of Class/MOP/Class.pm, avg 107µs/call
sub create {
582700ns my $class = shift;
5921µs my @args = @_;
60
6122µs unshift @args, 'package' if @args % 2 == 1;
6222µs my %options = @args;
63
6422µs my $package = delete $options{package};
652500ns my $version = delete $options{version};
662200ns my $authority = delete $options{authority};
67
68216µs2168µs my $meta = $class->SUPER::create($package => %options);
# spent 168µs making 2 calls to Class::MOP::Package::create, avg 84µs/call
69
7024µs210µs $meta->_instantiate_module($version, $authority);
# spent 10µs making 2 calls to Class::MOP::Module::_instantiate_module, avg 5µs/call
71
7225µ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 10µs (9+1) within Class::MOP::Module::_instantiate_module which was called 2 times, avg 5µs/call: # 2 times (9µs+1µs) by Class::MOP::Module::create at line 70, avg 5µs/call
sub _instantiate_module {
8021µs my($self, $version, $authority) = @_;
8126µs21µs my $package_name = $self->name;
# spent 1µs making 2 calls to Class::MOP::Package::name, avg 650ns/call
82
832400ns $self->add_package_symbol('$VERSION' => $version)
84 if defined $version;
852300ns $self->add_package_symbol('$AUTHORITY' => $authority)
86 if defined $authority;
87
8824µs return;
89}
90
9113µs1;
92
93# ABSTRACT: Module Meta Object
94
95__END__