← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:10 2016

Filename/usr/local/lib/perl/5.18.2/Class/MOP/Module.pm
StatementsExecuted 188 statements in 562µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1211167µs9.71msClass::MOP::Module::::createClass::MOP::Module::create
121158µs62µsClass::MOP::Module::::_instantiate_moduleClass::MOP::Module::_instantiate_module
1119µs18µsClass::MOP::Module::::BEGIN@4Class::MOP::Module::BEGIN@4
1116µs2.37msClass::MOP::Module::::BEGIN@7Class::MOP::Module::BEGIN@7
1115µs8µsClass::MOP::Module::::BEGIN@5Class::MOP::Module::BEGIN@5
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
1package Class::MOP::Module;
21400nsour $VERSION = '2.1604';
3
4218µs226µs
# spent 18µs (9+9) within Class::MOP::Module::BEGIN@4 which was called: # once (9µs+9µs) by parent::import at line 4
use strict;
# spent 18µs making 1 call to Class::MOP::Module::BEGIN@4 # spent 9µs making 1 call to strict::import
5218µs211µs
# spent 8µs (5+3) within Class::MOP::Module::BEGIN@5 which was called: # once (5µs+3µs) by parent::import at line 5
use warnings;
# spent 8µs making 1 call to Class::MOP::Module::BEGIN@5 # spent 3µs making 1 call to warnings::import
6
72303µs22.37ms
# spent 2.37ms (6µs+2.36) within Class::MOP::Module::BEGIN@7 which was called: # once (6µs+2.36ms) by parent::import at line 7
use parent 'Class::MOP::Package';
# spent 2.37ms making 1 call to Class::MOP::Module::BEGIN@7 # spent 2.36ms making 1 call to parent::import, recursion: max depth 1, sum of overlapping time 2.36ms
8
9sub _new {
10 my $class = shift;
11 return Class::MOP::Class->initialize($class)->new_object(@_)
12 if $class ne __PACKAGE__;
13
14 my $params = @_ == 1 ? $_[0] : {@_};
15 return bless {
16 # Need to quote package to avoid a problem with PPI mis-parsing this
17 # as a package statement.
18
19 # from Class::MOP::Package
20 'package' => $params->{package},
21 namespace => \undef,
22
23 # attributes
24 version => \undef,
25 authority => \undef
26 } => $class;
27}
28
29sub version {
30 my $self = shift;
31 ${$self->get_or_add_package_symbol('$VERSION')};
32}
33
34sub authority {
35 my $self = shift;
36 ${$self->get_or_add_package_symbol('$AUTHORITY')};
37}
38
39sub identifier {
40 my $self = shift;
41 join '-' => (
42 $self->name,
43 ($self->version || ()),
44 ($self->authority || ()),
45 );
46}
47
48
# spent 9.71ms (167µs+9.55) within Class::MOP::Module::create which was called 12 times, avg 809µs/call: # 12 times (167µs+9.55ms) by Class::MOP::Class::create at line 444 of Class/MOP/Class.pm, avg 809µs/call
sub create {
49126µs my $class = shift;
50129µs my @args = @_;
51
521212µs unshift @args, 'package' if @args % 2 == 1;
531223µs my %options = @args;
54
55128µs my $package = delete $options{package};
56126µs my $version = delete $options{version};
57125µs my $authority = delete $options{authority};
58
591228µs129.48ms my $meta = $class->SUPER::create($package => %options);
# spent 9.48ms making 12 calls to Class::MOP::Package::create, avg 790µs/call
60
611229µs1262µs $meta->_instantiate_module($version, $authority);
# spent 62µs making 12 calls to Class::MOP::Module::_instantiate_module, avg 5µs/call
62
631229µs return $meta;
64}
65
66sub _anon_package_prefix { 'Class::MOP::Module::__ANON__::SERIAL::' }
67
68sub _anon_cache_key {
69 my $class = shift;
70 my %options = @_;
71 $class->_throw_exception( PackagesAndModulesAreNotCachable => class_name => $class,
72 params => \%options,
73 is_module => 1
74 );
75}
76
77
# spent 62µs (58+5) within Class::MOP::Module::_instantiate_module which was called 12 times, avg 5µs/call: # 12 times (58µs+5µs) by Class::MOP::Module::create at line 61, avg 5µs/call
sub _instantiate_module {
78125µs my($self, $version, $authority) = @_;
791233µs125µs my $package_name = $self->name;
# spent 5µs making 12 calls to Class::MOP::Package::name, avg 392ns/call
80
81123µs $self->add_package_symbol('$VERSION' => $version)
82 if defined $version;
83123µs $self->add_package_symbol('$AUTHORITY' => $authority)
84 if defined $authority;
85
861222µs return;
87}
88
8912µs1;
90
91# ABSTRACT: Module Meta Object
92
93__END__