← Index
NYTProf Performance Profile   « line view »
For index.cgi
  Run on Sat May 9 17:18:47 2020
Reported on Sat May 9 17:19:07 2020

Filename/usr/local/share/perl/5.18.2/Moo/Object.pm
StatementsExecuted 41 statements in 846µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111386µs438µsMoo::Object::::metaMoo::Object::meta
21146µs63µsMoo::Object::::newMoo::Object::new
53332µs32µsMoo::Object::::BUILDARGSMoo::Object::BUILDARGS
81115µs15µsMoo::Object::::doesMoo::Object::does
11114µs43µsMoo::Object::::BEGIN@3Moo::Object::BEGIN@3
11112µs25µsMoo::Object::::BEGIN@65Moo::Object::BEGIN@65
0000s0sMoo::Object::::BUILDALLMoo::Object::BUILDALL
0000s0sMoo::Object::::DEMOLISHALLMoo::Object::DEMOLISHALL
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
32509µs271µs
# spent 43µs (14+29) within Moo::Object::BEGIN@3 which was called: # once (14µs+29µs) by Moo::import at line 3
use Moo::_strictures;
# spent 43µs making 1 call to Moo::Object::BEGIN@3 # spent 29µs making 1 call to Moo::_strictures::import
4
51400nsour %NO_BUILD;
61200nsour %NO_DEMOLISH;
71200nsour $BUILD_MAKER;
81100nsour $DEMOLISH_MAKER;
9
10
# spent 63µs (46+17) within Moo::Object::new which was called 2 times, avg 32µs/call: # 2 times (46µs+17µs) by Moo::_accessor_maker_for at line 147 of Moo.pm, avg 32µs/call
sub new {
1121µs my $class = shift;
1222µs unless (exists $NO_DEMOLISH{$class}) {
13112µs13µs unless ($NO_DEMOLISH{$class} = !$class->can('DEMOLISH')) {
# spent 3µs making 1 call to UNIVERSAL::can
14 ($DEMOLISH_MAKER ||= do {
15 require Method::Generate::DemolishAll;
16 Method::Generate::DemolishAll->new
17 })->generate_method($class);
18 }
19 }
2028µs29µs my $proto = $class->BUILDARGS(@_);
# spent 9µs making 2 calls to Moo::Object::BUILDARGS, avg 5µs/call
2128µs $NO_BUILD{$class} and
22 return bless({}, $class);
23112µs14µs $NO_BUILD{$class} = !$class->can('BUILD') unless exists $NO_BUILD{$class};
# spent 4µs making 1 call to UNIVERSAL::can
24110µ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 32µs within Moo::Object::BUILDARGS which was called 5 times, avg 6µs/call: # 2 times (16µs+0s) by String::Markov::__ANON__[/usr/local/share/perl/5.18.2/String/Markov.pm:45] at line 44 of String/Markov.pm, avg 8µs/call # 2 times (9µs+0s) by Moo::Object::new at line 20, avg 5µs/call # once (8µs+0s) by Method::Generate::Constructor::new at line 242 of Method/Generate/Constructor.pm
sub BUILDARGS {
3154µs my $class = shift;
32 scalar @_ == 1
33 ? ref $_[0] eq 'HASH'
34543µs ? { %{ $_[0] } }
35 : die "Single parameters to new() must be a HASH ref"
36 . " data => ". $_[0] ."\n"
37 : @_ % 2
38 ? die "The new() method for $class expects a hash reference or a"
39 . " key/value list. You passed an odd number of arguments\n"
40 : {@_}
41 ;
42}
43
44sub BUILDALL {
45 my $self = shift;
46 $self->${\(($BUILD_MAKER ||= do {
47 require Method::Generate::BuildAll;
48 Method::Generate::BuildAll->new
49 })->generate_method(ref($self)))}(@_);
50}
51
52sub DEMOLISHALL {
53 my $self = shift;
54 $self->${\(($DEMOLISH_MAKER ||= do {
55 require Method::Generate::DemolishAll;
56 Method::Generate::DemolishAll->new
57 })->generate_method(ref($self)))}(@_);
58}
59
60
# spent 15µs within Moo::Object::does which was called 8 times, avg 2µs/call: # 8 times (15µs+0s) by namespace::autoclean::__ANON__[/usr/local/share/perl/5.18.2/namespace/autoclean.pm:210] at line 208 of namespace/autoclean.pm, avg 2µs/call
sub does {
61828µs return !!0
62 unless ($INC{'Moose/Role.pm'} || $INC{'Role/Tiny.pm'});
63 require Moo::Role;
64 my $does = Moo::Role->can("does_role");
652107µs238µs
# spent 25µs (12+13) within Moo::Object::BEGIN@65 which was called: # once (12µs+13µs) by Moo::import at line 65
{ no warnings 'redefine'; *does = $does }
# spent 25µs making 1 call to Moo::Object::BEGIN@65 # spent 13µs making 1 call to warnings::unimport
66 goto &$does;
67}
68
69# duplicated in Moo::Role
70
# spent 438µs (386+52) within Moo::Object::meta which was called: # once (386µs+52µs) by main::BEGIN@7 at line 194 of String/Markov.pm
sub meta {
71186µs require Moo::HandleMoose::FakeMetaClass;
7212µs my $class = ref($_[0])||$_[0];
7319µs bless({ name => $class }, 'Moo::HandleMoose::FakeMetaClass');
74}
75
7613µs1;