← Index
NYTProf Performance Profile   « line view »
For fastest.pl
  Run on Fri Jan 31 20:48:16 2014
Reported on Fri Jan 31 20:49:40 2014

Filename/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Class/MOP/Module.pm
StatementsExecuted 44 statements in 736µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
21142µs257µsClass::MOP::Module::::createClass::MOP::Module::create
21115µs16µsClass::MOP::Module::::_instantiate_moduleClass::MOP::Module::_instantiate_module
11114µs19µsClass::MOP::Module::::BEGIN@11Class::MOP::Module::BEGIN@11
11111µs11µsClass::MOP::Module::::BEGIN@3Class::MOP::Module::BEGIN@3
1119µs3.93msClass::MOP::Module::::BEGIN@16Class::MOP::Module::BEGIN@16
1119µs40µsClass::MOP::Module::::BEGIN@13Class::MOP::Module::BEGIN@13
1119µs40µsClass::MOP::Module::::BEGIN@14Class::MOP::Module::BEGIN@14
1118µs24µsClass::MOP::Module::::BEGIN@10Class::MOP::Module::BEGIN@10
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 11µs within Class::MOP::Module::BEGIN@3 which was called: # once (11µs+0s) by base::import at line 5
BEGIN {
417µs $Class::MOP::Module::AUTHORITY = 'cpan:STEVAN';
5148µs111µs}
# spent 11µs making 1 call to Class::MOP::Module::BEGIN@3
6{
721µs $Class::MOP::Module::VERSION = '2.1005';
8}
9
10230µs239µs
# spent 24µs (8+15) within Class::MOP::Module::BEGIN@10 which was called: # once (8µs+15µs) by base::import at line 10
use strict;
# spent 24µs making 1 call to Class::MOP::Module::BEGIN@10 # spent 16µs making 1 call to strict::import
11234µs224µs
# spent 19µs (14+5) within Class::MOP::Module::BEGIN@11 which was called: # once (14µs+5µs) by base::import at line 11
use warnings;
# spent 19µs making 1 call to Class::MOP::Module::BEGIN@11 # spent 4µs making 1 call to warnings::import
12
13235µs270µs
# spent 40µs (9+30) within Class::MOP::Module::BEGIN@13 which was called: # once (9µs+30µs) by base::import at line 13
use Carp 'confess';
# spent 40µs making 1 call to Class::MOP::Module::BEGIN@13 # spent 30µs making 1 call to Exporter::import
14233µs271µs
# spent 40µs (9+31) within Class::MOP::Module::BEGIN@14 which was called: # once (9µs+31µs) by base::import at line 14
use Scalar::Util 'blessed';
# spent 40µs making 1 call to Class::MOP::Module::BEGIN@14 # spent 31µs making 1 call to Exporter::import
15
162489µs23.93ms
# spent 3.93ms (9µs+3.92) within Class::MOP::Module::BEGIN@16 which was called: # once (9µs+3.92ms) by base::import at line 16
use base 'Class::MOP::Package';
# spent 3.93ms making 1 call to Class::MOP::Module::BEGIN@16 # spent 3.92ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 3.92ms
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 257µs (42+215) within Class::MOP::Module::create which was called 2 times, avg 128µs/call: # 2 times (42µs+215µs) by Class::MOP::Class::create at line 446 of Class/MOP/Class.pm, avg 128µs/call
sub create {
582600ns my $class = shift;
5921µs my @args = @_;
60
6123µs unshift @args, 'package' if @args % 2 == 1;
6222µs my %options = @args;
63
6422µs my $package = delete $options{package};
652800ns my $version = delete $options{version};
6621µs my $authority = delete $options{authority};
67
6827µs2199µs my $meta = $class->SUPER::create($package => %options);
# spent 199µs making 2 calls to Class::MOP::Package::create, avg 100µs/call
69
70212µs216µs $meta->_instantiate_module($version, $authority);
# spent 16µs making 2 calls to Class::MOP::Module::_instantiate_module, avg 8µs/call
71
7228µ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 16µs (15+1) within Class::MOP::Module::_instantiate_module which was called 2 times, avg 8µs/call: # 2 times (15µs+1µs) by Class::MOP::Module::create at line 70, avg 8µs/call
sub _instantiate_module {
8021µs my($self, $version, $authority) = @_;
8129µs21µs my $package_name = $self->name;
# spent 1µs making 2 calls to Class::MOP::Package::name, avg 600ns/call
82
832600ns $self->add_package_symbol('$VERSION' => $version)
84 if defined $version;
852400ns $self->add_package_symbol('$AUTHORITY' => $authority)
86 if defined $authority;
87
8827µs return;
89}
90
9114µs1;
92
93# ABSTRACT: Module Meta Object
94
95__END__