← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:14 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP/Module.pm
StatementsExecuted 164 statements in 558µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1011110µs3.81msClass::MOP::Module::::createClass::MOP::Module::create
101139µs44µsClass::MOP::Module::::_instantiate_moduleClass::MOP::Module::_instantiate_module
1117µs7µsClass::MOP::Module::::BEGIN@3Class::MOP::Module::BEGIN@3
1116µs3.99msClass::MOP::Module::::BEGIN@16Class::MOP::Module::BEGIN@16
1116µs26µsClass::MOP::Module::::BEGIN@14Class::MOP::Module::BEGIN@14
1116µs9µsClass::MOP::Module::::BEGIN@11Class::MOP::Module::BEGIN@11
1116µs25µsClass::MOP::Module::::BEGIN@13Class::MOP::Module::BEGIN@13
1115µs16µ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 7µs within Class::MOP::Module::BEGIN@3 which was called: # once (7µs+0s) by base::import at line 5
BEGIN {
414µs $Class::MOP::Module::AUTHORITY = 'cpan:STEVAN';
5126µs17µs}
# spent 7µs making 1 call to Class::MOP::Module::BEGIN@3
6{
72900ns $Class::MOP::Module::VERSION = '2.1005';
8}
9
10219µs226µs
# spent 16µs (5+11) within Class::MOP::Module::BEGIN@10 which was called: # once (5µs+11µs) by base::import at line 10
use strict;
# spent 16µs making 1 call to Class::MOP::Module::BEGIN@10 # spent 10µs making 1 call to strict::import
11224µs212µs
# spent 9µs (6+3) within Class::MOP::Module::BEGIN@11 which was called: # once (6µs+3µs) by base::import at line 11
use warnings;
# spent 9µs making 1 call to Class::MOP::Module::BEGIN@11 # spent 3µs making 1 call to warnings::import
12
13220µs244µs
# spent 25µs (6+19) within Class::MOP::Module::BEGIN@13 which was called: # once (6µs+19µs) by base::import at line 13
use Carp 'confess';
# spent 25µs making 1 call to Class::MOP::Module::BEGIN@13 # spent 19µs making 1 call to Exporter::import
14224µs246µs
# spent 26µs (6+20) within Class::MOP::Module::BEGIN@14 which was called: # once (6µs+20µs) by base::import at line 14
use Scalar::Util 'blessed';
# spent 26µs making 1 call to Class::MOP::Module::BEGIN@14 # spent 20µs making 1 call to Exporter::import
15
162303µs23.99ms
# spent 3.99ms (6µs+3.98) within Class::MOP::Module::BEGIN@16 which was called: # once (6µs+3.98ms) by base::import at line 16
use base 'Class::MOP::Package';
# spent 3.99ms making 1 call to Class::MOP::Module::BEGIN@16 # spent 3.98ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 3.98ms
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 3.81ms (110µs+3.70) within Class::MOP::Module::create which was called 10 times, avg 381µs/call: # 10 times (110µs+3.70ms) by Class::MOP::Class::create at line 446 of Class/MOP/Class.pm, avg 381µs/call
sub create {
58102µs my $class = shift;
59107µs my @args = @_;
60
61109µs unshift @args, 'package' if @args % 2 == 1;
62107µs my %options = @args;
63
64105µs my $package = delete $options{package};
65102µs my $version = delete $options{version};
66103µs my $authority = delete $options{authority};
67
681019µs103.65ms my $meta = $class->SUPER::create($package => %options);
# spent 3.65ms making 10 calls to Class::MOP::Package::create, avg 365µs/call
69
701016µs1044µs $meta->_instantiate_module($version, $authority);
# spent 44µs making 10 calls to Class::MOP::Module::_instantiate_module, avg 4µs/call
71
721021µ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 44µs (39+4) within Class::MOP::Module::_instantiate_module which was called 10 times, avg 4µs/call: # 10 times (39µs+4µs) by Class::MOP::Module::create at line 70, avg 4µs/call
sub _instantiate_module {
80103µs my($self, $version, $authority) = @_;
811023µs104µs my $package_name = $self->name;
# spent 4µs making 10 calls to Class::MOP::Package::name, avg 430ns/call
82
83102µs $self->add_package_symbol('$VERSION' => $version)
84 if defined $version;
85102µs $self->add_package_symbol('$AUTHORITY' => $authority)
86 if defined $authority;
87
881016µs return;
89}
90
9112µs1;
92
93# ABSTRACT: Module Meta Object
94
95__END__