← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Thu Dec 15 15:23:56 2022
Reported on Thu Dec 15 15:27:01 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Moo/Object.pm
StatementsExecuted 153 statements in 680µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2122208µs293µsMoo::Object::::newMoo::Object::new
244489µs89µsMoo::Object::::BUILDARGSMoo::Object::BUILDARGS
11114µs16µsMoo::Object::::BEGIN@2Moo::Object::BEGIN@2
11112µs14µsMoo::Object::::doesMoo::Object::does
1115µs16µsMoo::Object::::BEGIN@67Moo::Object::BEGIN@67
1112µs15µsMoo::Object::::BEGIN@3Moo::Object::BEGIN@3
1112µs2µsMoo::Object::::BEGIN@5Moo::Object::BEGIN@5
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;
2217µs218µs
# spent 16µs (14+2) within Moo::Object::BEGIN@2 which was called: # once (14µs+2µs) by Moo::make_class at line 2
use strict;
# spent 16µs making 1 call to Moo::Object::BEGIN@2 # spent 2µs making 1 call to strict::import
3211µs228µs
# spent 15µs (2+13) within Moo::Object::BEGIN@3 which was called: # once (2µs+13µs) by Moo::make_class at line 3
use warnings;
# spent 15µs making 1 call to Moo::Object::BEGIN@3 # spent 13µs making 1 call to warnings::import
4
52232µs12µs
# spent 2µs within Moo::Object::BEGIN@5 which was called: # once (2µs+0s) by Moo::make_class at line 5
use Carp ();
# spent 2µs making 1 call to Moo::Object::BEGIN@5
6
7our %NO_BUILD;
8our %NO_DEMOLISH;
9our $BUILD_MAKER;
10our $DEMOLISH_MAKER;
11
12
# spent 293µs (208+85) within Moo::Object::new which was called 21 times, avg 14µs/call: # 18 times (143µs+62µs) by Moo::_accessor_maker_for at line 197 of Moo.pm, avg 11µs/call # 3 times (65µs+23µs) by Method::Generate::Constructor::buildall_generator at line 62 of Method/Generate/Constructor.pm, avg 29µs/call
sub new {
132118µs my $class = shift;
142119µs unless (exists $NO_DEMOLISH{$class}) {
15217µs24µs unless ($NO_DEMOLISH{$class} = !$class->can('DEMOLISH')) {
# spent 4µs making 2 calls to UNIVERSAL::can, avg 2µs/call
16 ($DEMOLISH_MAKER ||= do {
17 require Method::Generate::DemolishAll;
18 Method::Generate::DemolishAll->new
19 })->generate_method($class);
20 }
21 }
222151µs2178µs my $proto = $class->BUILDARGS(@_);
# spent 78µs making 21 calls to Moo::Object::BUILDARGS, avg 4µs/call
232188µs $NO_BUILD{$class} and
24 return bless({}, $class);
2527µs23µs $NO_BUILD{$class} = !$class->can('BUILD') unless exists $NO_BUILD{$class};
# spent 3µs making 2 calls to UNIVERSAL::can, avg 2µs/call
2628µs $NO_BUILD{$class}
27 ? bless({}, $class)
28 : bless({}, $class)->BUILDALL($proto);
29}
30
31# Inlined into Method::Generate::Constructor::_generate_args() - keep in sync
32
# spent 89µs within Moo::Object::BUILDARGS which was called 24 times, avg 4µs/call: # 21 times (78µs+0s) by Moo::Object::new at line 22, avg 4µs/call # once (5µs+0s) by OpenAPI::Modern::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/OpenAPI/Modern.pm:79] at line 55 of OpenAPI/Modern.pm # once (3µs+0s) by Method::Generate::Constructor::new at line 248 of Method/Generate/Constructor.pm # once (3µs+0s) by JSON::Schema::Modern::__ANON__[/Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm:133] at line 127 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm
sub BUILDARGS {
332410µs my $class = shift;
34 scalar @_ == 1
35 ? ref $_[0] eq 'HASH'
3624106µs ? { %{ $_[0] } }
37 : Carp::croak("Single parameters to new() must be a HASH ref"
38 . " data => ". $_[0])
39 : @_ % 2
40 ? Carp::croak("The new() method for $class expects a hash reference or a"
41 . " key/value list. You passed an odd number of arguments")
42 : {@_}
43 ;
44}
45
46sub BUILDALL {
47 my $self = shift;
48 $self->${\(($BUILD_MAKER ||= do {
49 require Method::Generate::BuildAll;
50 Method::Generate::BuildAll->new
51 })->generate_method(ref($self)))}(@_);
52}
53
54sub DEMOLISHALL {
55 my $self = shift;
56 $self->${\(($DEMOLISH_MAKER ||= do {
57 require Method::Generate::DemolishAll;
58 Method::Generate::DemolishAll->new
59 })->generate_method(ref($self)))}(@_);
60}
61
62
# spent 14µs (12+2) within Moo::Object::does which was called: # once (12µs+2µs) by MooX::TypeTiny::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/MooX/TypeTiny.pm:25] at line 21 of MooX/TypeTiny.pm
sub does {
63 return !!0
6412µs unless ($INC{'Moose/Role.pm'} || $INC{'Role/Tiny.pm'});
6510s require Moo::Role;
6615µs12µs my $does = Moo::Role->can("does_role");
# spent 2µs making 1 call to UNIVERSAL::can
67483µs227µs
# spent 16µs (5+11) within Moo::Object::BEGIN@67 which was called: # once (5µs+11µs) by Moo::make_class at line 67
{ no warnings 'redefine'; *does = $does }
# spent 16µs making 1 call to Moo::Object::BEGIN@67 # spent 11µs making 1 call to warnings::unimport
6814µs113µs goto &$does;
# spent 13µs making 1 call to Moo::Role::does_role
69}
70
71# duplicated in Moo::Role
72sub meta {
73 require Moo::HandleMoose::FakeMetaClass;
74 my $class = ref($_[0])||$_[0];
75 bless({ name => $class }, 'Moo::HandleMoose::FakeMetaClass');
76}
77
7812µs1;