← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:07 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Moo/Object.pm
StatementsExecuted 4164 statements in 8.54ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1022336.61ms6.61msMoo::Object::::BUILDARGSMoo::Object::BUILDARGS
2033142µs205µsMoo::Object::::newMoo::Object::new
11119µs20µsMoo::Object::::doesMoo::Object::does
11110µs17µsMoo::Object::::BEGIN@3Moo::Object::BEGIN@3
1116µs14µsMoo::Object::::BEGIN@69Moo::Object::BEGIN@69
0000s0sMoo::Object::::BUILDALLMoo::Object::BUILDALL
0000s0sMoo::Object::::DEMOLISHALLMoo::Object::DEMOLISHALL
0000s0sMoo::Object::::metaMoo::Object::meta
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moo::Object;
2
32272µs224µs
# spent 17µs (10+7) within Moo::Object::BEGIN@3 which was called: # once (10µs+7µs) by Moo::import at line 3
use Moo::_strictures;
# spent 17µs making 1 call to Moo::Object::BEGIN@3 # spent 8µs making 1 call to Moo::_strictures::import
4
5our %NO_BUILD;
6our %NO_DEMOLISH;
7our $BUILD_MAKER;
8our $DEMOLISH_MAKER;
9
10
# spent 205µs (142+63) within Moo::Object::new which was called 20 times, avg 10µs/call: # 11 times (58µs+31µs) by Moo::_accessor_maker_for at line 147 of Moo.pm, avg 8µs/call # 7 times (67µs+25µs) by Moo::Role::has at line 57 of Moo/Role.pm, avg 13µs/call # 2 times (16µs+7µs) by Method::Generate::Constructor::buildall_generator at line 63 of Method/Generate/Constructor.pm, avg 12µs/call
sub new {
11206µs my $class = shift;
122015µs unless (exists $NO_DEMOLISH{$class}) {
13216µs25µs unless ($NO_DEMOLISH{$class} = !$class->can('DEMOLISH')) {
# spent 5µs making 2 calls to UNIVERSAL::can, avg 2µs/call
14 ($DEMOLISH_MAKER ||= do {
15 require Method::Generate::DemolishAll;
16 Method::Generate::DemolishAll->new
17 })->generate_method($class);
18 }
19 }
202038µs2052µs my $proto = $class->BUILDARGS(@_);
# spent 52µs making 20 calls to Moo::Object::BUILDARGS, avg 3µs/call
212054µs $NO_BUILD{$class} and
22 return bless({}, $class);
23212µs27µs $NO_BUILD{$class} = !$class->can('BUILD') unless exists $NO_BUILD{$class};
# spent 7µs making 2 calls to UNIVERSAL::can, avg 3µs/call
2426µs $NO_BUILD{$class}
25 ? bless({}, $class)
26 : bless({}, $class)->BUILDALL($proto);
27}
28
29# Inlined into Method::Generate::Constructor::_generate_args() - keep in sync
30
# spent 6.61ms within Moo::Object::BUILDARGS which was called 1022 times, avg 6µs/call: # 1001 times (6.56ms+0s) by Search::Elasticsearch::Role::CxnPool::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Role/CxnPool.pm:33] at line 26 of Search/Elasticsearch/Role/CxnPool.pm, avg 7µs/call # 20 times (52µs+0s) by Moo::Object::new at line 20, avg 3µs/call # once (2µs+0s) by Method::Generate::Constructor::new at line 243 of Method/Generate/Constructor.pm
sub BUILDARGS {
311022487µs my $class = shift;
321022742µs if ( scalar @_ == 1 ) {
331001902µs unless ( defined $_[0] && ref $_[0] eq 'HASH' ) {
34 die "Single parameters to new() must be a HASH ref"
35 ." data => ". $_[0] ."\n";
36 }
3710015.86ms return { %{ $_[0] } };
38 }
39 elsif ( @_ % 2 ) {
40 die "The new() method for $class expects a hash reference or a"
41 . " key/value list. You passed an odd number of arguments\n";
42 }
43 else {
442147µs return {@_};
45 }
46}
47
48sub BUILDALL {
49 my $self = shift;
50 $self->${\(($BUILD_MAKER ||= do {
51 require Method::Generate::BuildAll;
52 Method::Generate::BuildAll->new
53 })->generate_method(ref($self)))}(@_);
54}
55
56sub DEMOLISHALL {
57 my $self = shift;
58 $self->${\(($DEMOLISH_MAKER ||= do {
59 require Method::Generate::DemolishAll;
60 Method::Generate::DemolishAll->new
61 })->generate_method(ref($self)))}(@_);
62}
63
64
# spent 20µs (19+700ns) within Moo::Object::does which was called: # once (19µs+700ns) by Search::Elasticsearch::Util::is_compat at line 96 of Search/Elasticsearch/Util.pm
sub does {
65 return !!0
6612µs unless ($INC{'Moose/Role.pm'} || $INC{'Role/Tiny.pm'});
671600ns require Moo::Role;
6814µs1700ns my $does = Moo::Role->can("does_role");
# spent 700ns making 1 call to UNIVERSAL::can
69463µs221µs
# spent 14µs (6+7) within Moo::Object::BEGIN@69 which was called: # once (6µs+7µs) by Moo::import at line 69
{ no warnings 'redefine'; *does = $does }
# spent 14µs making 1 call to Moo::Object::BEGIN@69 # spent 7µs making 1 call to warnings::unimport
7014µs111µs goto &$does;
# spent 11µs making 1 call to Moo::Role::does_role
71}
72
73# duplicated in Moo::Role
74sub meta {
75 require Moo::HandleMoose::FakeMetaClass;
76 my $class = ref($_[0])||$_[0];
77 bless({ name => $class }, 'Moo::HandleMoose::FakeMetaClass');
78}
79
8012µs1;