← 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:06 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose.pm
StatementsExecuted 161 statements in 2.38ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1114.09ms4.78msMoose::::BEGIN@38 Moose::BEGIN@38
1112.23ms12.5msMoose::::BEGIN@24 Moose::BEGIN@24
1112.21ms76.6msMoose::::BEGIN@15 Moose::BEGIN@15
1111.94ms9.78msMoose::::BEGIN@32 Moose::BEGIN@32
1111.18ms4.72msMoose::::BEGIN@25 Moose::BEGIN@25
1111.02ms1.69msMoose::::BEGIN@35 Moose::BEGIN@35
111987µs1.06msMoose::::BEGIN@11 Moose::BEGIN@11
111734µs8.26msMoose::::BEGIN@12 Moose::BEGIN@12
111666µs2.36msMoose::::BEGIN@33 Moose::BEGIN@33
111601µs1.43msMoose::::BEGIN@36 Moose::BEGIN@36
111598µs6.93msMoose::::BEGIN@30 Moose::BEGIN@30
111478µs1.57msMoose::::BEGIN@34 Moose::BEGIN@34
111461µs939µsMoose::::BEGIN@37 Moose::BEGIN@37
111459µs82.8msMoose::::BEGIN@26 Moose::BEGIN@26
111214µs922µsMoose::::BEGIN@43 Moose::BEGIN@43
111164µs947µsMoose::::BEGIN@28 Moose::BEGIN@28
111134µs1.98msMoose::::BEGIN@14 Moose::BEGIN@14
11144µs1.83msMoose::::init_meta Moose::init_meta
11110µs10µsMoose::::BEGIN@7 Moose::BEGIN@7
1119µs11µsDBIx::MultiStatementDo::::BEGIN@1DBIx::MultiStatementDo::BEGIN@1
1119µs75µsMoose::::BEGIN@41 Moose::BEGIN@41
1116µs51µsMoose::::BEGIN@10 Moose::BEGIN@10
1116µs771µsMoose::::BEGIN@40 Moose::BEGIN@40
1115µs11µsDBIx::MultiStatementDo::::BEGIN@2DBIx::MultiStatementDo::BEGIN@2
1113µs3µsMoose::::BEGIN@17 Moose::BEGIN@17
1113µs3µsMoose::::BEGIN@27 Moose::BEGIN@27
1112µs2µsMoose::::BEGIN@9 Moose::BEGIN@9
1112µs2µsMoose::::BEGIN@19 Moose::BEGIN@19
0000s0sMoose::::_get_caller Moose::_get_caller
0000s0sMoose::::inner Moose::inner
0000s0sMoose::::super Moose::super
0000s0sMoose::::throw_error Moose::throw_error
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1216µs213µs
# spent 11µs (9+2) within DBIx::MultiStatementDo::BEGIN@1 which was called: # once (9µs+2µs) by DBIx::MultiStatementDo::BEGIN@8 at line 1
use strict;
# spent 11µs making 1 call to DBIx::MultiStatementDo::BEGIN@1 # spent 2µs making 1 call to strict::import
2231µs217µs
# spent 11µs (5+6) within DBIx::MultiStatementDo::BEGIN@2 which was called: # once (5µs+6µs) by DBIx::MultiStatementDo::BEGIN@8 at line 2
use warnings;
# spent 11µs making 1 call to DBIx::MultiStatementDo::BEGIN@2 # spent 6µs making 1 call to warnings::import
3package Moose; # git description: 2.1604-21-g729a32b
41400nsour $VERSION = '2.1605';
510sour $AUTHORITY = 'cpan:STEVAN';
6
7227µs110µs
# spent 10µs within Moose::BEGIN@7 which was called: # once (10µs+0s) by DBIx::MultiStatementDo::BEGIN@8 at line 7
use 5.008003;
# spent 10µs making 1 call to Moose::BEGIN@7
8
9212µs12µs
# spent 2µs within Moose::BEGIN@9 which was called: # once (2µs+0s) by DBIx::MultiStatementDo::BEGIN@8 at line 9
use Scalar::Util ();
# spent 2µs making 1 call to Moose::BEGIN@9
10223µs296µs
# spent 51µs (6+45) within Moose::BEGIN@10 which was called: # once (6µs+45µs) by DBIx::MultiStatementDo::BEGIN@8 at line 10
use Carp 'carp';
# spent 51µs making 1 call to Moose::BEGIN@10 # spent 45µs making 1 call to Exporter::import
11296µs21.07ms
# spent 1.06ms (987µs+72µs) within Moose::BEGIN@11 which was called: # once (987µs+72µs) by DBIx::MultiStatementDo::BEGIN@8 at line 11
use Module::Runtime 'module_notional_filename';
# spent 1.06ms making 1 call to Moose::BEGIN@11 # spent 11µs making 1 call to Module::Runtime::import
12261µs28.29ms
# spent 8.26ms (734µs+7.53) within Moose::BEGIN@12 which was called: # once (734µs+7.53ms) by DBIx::MultiStatementDo::BEGIN@8 at line 12
use Class::Load 'is_class_loaded';
# spent 8.26ms making 1 call to Moose::BEGIN@12 # spent 27µs making 1 call to Exporter::import
13
14277µs21.98ms
# spent 1.98ms (134µs+1.84) within Moose::BEGIN@14 which was called: # once (134µs+1.84ms) by DBIx::MultiStatementDo::BEGIN@8 at line 14
use Moose::Deprecated;
# spent 1.98ms making 1 call to Moose::BEGIN@14 # spent 4µs making 1 call to Package::DeprecationManager::__ANON__[Package/DeprecationManager.pm:87]
15276µs276.6ms
# spent 76.6ms (2.21+74.4) within Moose::BEGIN@15 which was called: # once (2.21ms+74.4ms) by DBIx::MultiStatementDo::BEGIN@8 at line 15
use Moose::Exporter;
# spent 76.6ms making 1 call to Moose::BEGIN@15 # spent 16µs making 1 call to Moose::Exporter::import
16
17229µs13µs
# spent 3µs within Moose::BEGIN@17 which was called: # once (3µs+0s) by DBIx::MultiStatementDo::BEGIN@8 at line 17
use Class::MOP;
# spent 3µs making 1 call to Moose::BEGIN@17
18
19
# spent 2µs within Moose::BEGIN@19 which was called: # once (2µs+0s) by DBIx::MultiStatementDo::BEGIN@8 at line 22
BEGIN {
2012µs die "Class::MOP version $Moose::VERSION required--this is version $Class::MOP::VERSION"
21 if $Moose::VERSION && $Class::MOP::VERSION ne $Moose::VERSION;
22111µs12µs}
# spent 2µs making 1 call to Moose::BEGIN@19
23
24290µs112.5ms
# spent 12.5ms (2.23+10.3) within Moose::BEGIN@24 which was called: # once (2.23ms+10.3ms) by DBIx::MultiStatementDo::BEGIN@8 at line 24
use Moose::Meta::Class;
# spent 12.5ms making 1 call to Moose::BEGIN@24
25289µs14.72ms
# spent 4.72ms (1.18+3.55) within Moose::BEGIN@25 which was called: # once (1.18ms+3.55ms) by DBIx::MultiStatementDo::BEGIN@8 at line 25
use Moose::Meta::TypeConstraint;
# spent 4.72ms making 1 call to Moose::BEGIN@25
26294µs182.8ms
# spent 82.8ms (459µs+82.4) within Moose::BEGIN@26 which was called: # once (459µs+82.4ms) by DBIx::MultiStatementDo::BEGIN@8 at line 26
use Moose::Meta::TypeCoercion;
# spent 82.8ms making 1 call to Moose::BEGIN@26
27212µs13µs
# spent 3µs within Moose::BEGIN@27 which was called: # once (3µs+0s) by DBIx::MultiStatementDo::BEGIN@8 at line 27
use Moose::Meta::Attribute;
# spent 3µs making 1 call to Moose::BEGIN@27
28281µs1947µs
# spent 947µs (164+782) within Moose::BEGIN@28 which was called: # once (164µs+782µs) by DBIx::MultiStatementDo::BEGIN@8 at line 28
use Moose::Meta::Instance;
# spent 947µs making 1 call to Moose::BEGIN@28
29
30276µs16.93ms
# spent 6.93ms (598µs+6.33) within Moose::BEGIN@30 which was called: # once (598µs+6.33ms) by DBIx::MultiStatementDo::BEGIN@8 at line 30
use Moose::Object;
# spent 6.93ms making 1 call to Moose::BEGIN@30
31
32294µs19.78ms
# spent 9.78ms (1.94+7.84) within Moose::BEGIN@32 which was called: # once (1.94ms+7.84ms) by DBIx::MultiStatementDo::BEGIN@8 at line 32
use Moose::Meta::Role;
# spent 9.78ms making 1 call to Moose::BEGIN@32
33297µs12.36ms
# spent 2.36ms (666µs+1.69) within Moose::BEGIN@33 which was called: # once (666µs+1.69ms) by DBIx::MultiStatementDo::BEGIN@8 at line 33
use Moose::Meta::Role::Composite;
# spent 2.36ms making 1 call to Moose::BEGIN@33
34293µs11.57ms
# spent 1.57ms (478µs+1.10) within Moose::BEGIN@34 which was called: # once (478µs+1.10ms) by DBIx::MultiStatementDo::BEGIN@8 at line 34
use Moose::Meta::Role::Application;
# spent 1.57ms making 1 call to Moose::BEGIN@34
35277µs11.69ms
# spent 1.69ms (1.02+666µs) within Moose::BEGIN@35 which was called: # once (1.02ms+666µs) by DBIx::MultiStatementDo::BEGIN@8 at line 35
use Moose::Meta::Role::Application::RoleSummation;
# spent 1.69ms making 1 call to Moose::BEGIN@35
36273µs11.43ms
# spent 1.43ms (601µs+830µs) within Moose::BEGIN@36 which was called: # once (601µs+830µs) by DBIx::MultiStatementDo::BEGIN@8 at line 36
use Moose::Meta::Role::Application::ToClass;
# spent 1.43ms making 1 call to Moose::BEGIN@36
37271µs1939µs
# spent 939µs (461+478) within Moose::BEGIN@37 which was called: # once (461µs+478µs) by DBIx::MultiStatementDo::BEGIN@8 at line 37
use Moose::Meta::Role::Application::ToRole;
# spent 939µs making 1 call to Moose::BEGIN@37
38270µs14.78ms
# spent 4.78ms (4.09+689µs) within Moose::BEGIN@38 which was called: # once (4.09ms+689µs) by DBIx::MultiStatementDo::BEGIN@8 at line 38
use Moose::Meta::Role::Application::ToInstance;
# spent 4.78ms making 1 call to Moose::BEGIN@38
39
40224µs21.54ms
# spent 771µs (6+765) within Moose::BEGIN@40 which was called: # once (6µs+765µs) by DBIx::MultiStatementDo::BEGIN@8 at line 40
use Moose::Util::TypeConstraints;
# spent 771µs making 1 call to Moose::BEGIN@40 # spent 765µs making 1 call to Moose::Util::TypeConstraints::import
41219µs2142µs
# spent 75µs (9+67) within Moose::BEGIN@41 which was called: # once (9µs+67µs) by DBIx::MultiStatementDo::BEGIN@8 at line 41
use Moose::Util 'throw_exception';
# spent 75µs making 1 call to Moose::BEGIN@41 # spent 67µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
42
432622µs1922µs
# spent 922µs (214+707) within Moose::BEGIN@43 which was called: # once (214µs+707µs) by DBIx::MultiStatementDo::BEGIN@8 at line 43
use Moose::Meta::Attribute::Native;
# spent 922µs making 1 call to Moose::BEGIN@43
44
45sub extends {
46 my $meta = shift;
47
48 unless ( @_ )
49 {
50 throw_exception( ExtendsMissingArgs => class_name => $meta->name );
51 }
52 # this checks the metaclass to make sure
53 # it is correct, sometimes it can get out
54 # of sync when the classes are being built
55 $meta->superclasses(@_);
56}
57
58sub with {
59 Moose::Util::apply_all_roles(shift, @_);
60}
61
62sub throw_error {
63 shift;
64 Class::MOP::Object->throw_error(@_);
65}
66
67sub has {
684800ns my $meta = shift;
6941µs my $name = shift;
70
71411µs439µs my %context = Moose::Util::_caller_info;
# spent 39µs making 4 calls to Moose::Util::_caller_info, avg 10µs/call
7242µs $context{context} = 'has declaration';
7343µs $context{type} = 'class';
7448µs my @options = ( definition_context => \%context, @_ );
7544µs my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ];
76429µs413.1ms $meta->add_attribute( $_, @options ) for @$attrs;
# spent 13.1ms making 4 calls to Moose::Meta::Class::add_attribute, avg 3.27ms/call
77}
78
79sub before {
80 Moose::Util::add_method_modifier(shift, 'before', \@_);
81}
82
83sub after {
84 Moose::Util::add_method_modifier(shift, 'after', \@_);
85}
86
87sub around {
88 Moose::Util::add_method_modifier(shift, 'around', \@_);
89}
90
91our $SUPER_PACKAGE;
92our $SUPER_BODY;
93our @SUPER_ARGS;
94
95sub super {
96 if (@_) {
97 carp 'Arguments passed to super() are ignored';
98 }
99
100 # This check avoids a recursion loop - see
101 # t/bugs/super_recursion.t
102 return if defined $SUPER_PACKAGE && $SUPER_PACKAGE ne caller();
103 return unless $SUPER_BODY; $SUPER_BODY->(@SUPER_ARGS);
104}
105
106sub override {
107 my $meta = shift;
108 my ( $name, $method ) = @_;
109 $meta->add_override_method_modifier( $name => $method );
110}
111
112sub inner {
113 my $pkg = caller();
114 our ( %INNER_BODY, %INNER_ARGS );
115
116 if ( my $body = $INNER_BODY{$pkg} ) {
117 my @args = @{ $INNER_ARGS{$pkg} };
118 local $INNER_ARGS{$pkg};
119 local $INNER_BODY{$pkg};
120 return $body->(@args);
121 } else {
122 return;
123 }
124}
125
126sub augment {
127 my $meta = shift;
128 my ( $name, $method ) = @_;
129 $meta->add_augment_method_modifier( $name => $method );
130}
131
13214µs1576µsMoose::Exporter->setup_import_methods(
# spent 576µs making 1 call to Moose::Exporter::setup_import_methods
133 with_meta => [
134 qw( extends with has before after around override augment )
135 ],
136 as_is => [
137 qw( super inner ),
138 'Carp::confess',
139 'Scalar::Util::blessed',
140 ],
141);
142
143
# spent 1.83ms (44µs+1.79) within Moose::init_meta which was called: # once (44µs+1.79ms) by Moose::import at line 484 of Moose/Exporter.pm
sub init_meta {
1441300ns shift;
14512µs my %args = @_;
146
147 my $class = $args{for_class}
1481500ns or throw_exception( InitMetaRequiresClass => params => \%args );
149
1501500ns my $base_class = $args{base_class} || 'Moose::Object';
1511300ns my $metaclass = $args{metaclass} || 'Moose::Meta::Class';
15212µs my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta';
153
15418µs14µs throw_exception( MetaclassNotLoaded => class_name => $metaclass )
# spent 4µs making 1 call to Class::Load::XS::is_class_loaded
155 unless is_class_loaded($metaclass);
156
15713µs1700ns throw_exception( MetaclassMustBeASubclassOfMooseMetaClass => class_name => $metaclass )
# spent 700ns making 1 call to UNIVERSAL::isa
158 unless $metaclass->isa('Moose::Meta::Class');
159
160 # make a subtype for each Moose class
16114µs2476µs class_type($class)
# spent 461µs making 1 call to Moose::Util::TypeConstraints::class_type # spent 15µs making 1 call to Moose::Util::TypeConstraints::find_type_constraint
162 unless find_type_constraint($class);
163
1641200ns my $meta;
165
16611µs1900ns if ( $meta = Class::MOP::get_metaclass_by_name($class) ) {
# spent 900ns making 1 call to Class::MOP::get_metaclass_by_name
167 unless ( $meta->isa("Moose::Meta::Class") ) {
168 if ( $meta->isa('Moose::Meta::Role') ) {
169 throw_exception( MetaclassIsARoleNotASubclassOfGivenMetaclass => role_name => $class,
170 metaclass => $metaclass,
171 role => $meta
172 );
173 } else {
174 throw_exception( MetaclassIsNotASubclassOfGivenMetaclass => class_name => $class,
175 metaclass => $metaclass,
176 class => $meta
177 );
178 }
179 }
180 } else {
181 # no metaclass
182
183 # now we check whether our ancestors have metaclass, and if so borrow that
18416µs12µs my ( undef, @isa ) = @{ mro::get_linear_isa($class) };
# spent 2µs making 1 call to mro::get_linear_isa
185
18611µs foreach my $ancestor ( @isa ) {
187 my $ancestor_meta = Class::MOP::get_metaclass_by_name($ancestor) || next;
188
189 my $ancestor_meta_class = $ancestor_meta->_real_ref_name;
190
191 # if we have an ancestor metaclass that inherits $metaclass, we use
192 # that. This is like _fix_metaclass_incompatibility, but we can do it now.
193
194 # the case of having an ancestry is not very common, but arises in
195 # e.g. Reaction
196 unless ( $metaclass->isa( $ancestor_meta_class ) ) {
197 if ( $ancestor_meta_class->isa($metaclass) ) {
198 $metaclass = $ancestor_meta_class;
199 }
200 }
201 }
202
20312µs1412µs $meta = $metaclass->initialize($class);
# spent 412µs making 1 call to Moose::Meta::Class::initialize
20413µs213µs my $filename = module_notional_filename($meta->name);
# spent 13µs making 1 call to Module::Runtime::module_notional_filename # spent 200ns making 1 call to Class::MOP::Package::name
205 $INC{$filename} = '(set by Moose)'
2061800ns unless exists $INC{$filename};
207 }
208
2091600ns if (defined $meta_name) {
210 # also check for inherited non moose 'meta' method?
21111µs117µs my $existing = $meta->get_method($meta_name);
# spent 17µs making 1 call to Class::MOP::Mixin::HasMethods::get_method
2121100ns if ($existing && !$existing->isa('Class::MOP::Method::Meta')) {
213 Carp::cluck "Moose is overwriting an existing method named "
214 . "$meta_name in class $class with a method "
215 . "which returns the class's metaclass. If this is "
216 . "actually what you want, you should remove the "
217 . "existing method, otherwise, you should rename or "
218 . "disable this generated method using the "
219 . "'-meta_name' option to 'use Moose'.";
220 }
22112µs1362µs $meta->_add_meta_method($meta_name);
# spent 362µs making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method
222 }
223
224 # make sure they inherit from Moose::Object
22512µs2502µs $meta->superclasses($base_class)
# spent 502µs making 2 calls to Moose::Meta::Class::superclasses, avg 251µs/call
226 unless $meta->superclasses();
227
22813µs return $meta;
229}
230
231# This may be used in some older MooseX extensions.
232sub _get_caller {
233 goto &Moose::Exporter::_get_caller;
234}
235
236## make 'em all immutable
237
238$_->make_immutable(
239 inline_constructor => 1,
240 constructor_name => "_new",
241 # these are Class::MOP accessors, so they need inlining
242 inline_accessors => 1
2432249µs4256.9ms ) for grep { $_->is_mutable }
# spent 56.9ms making 21 calls to Class::MOP::Class::make_immutable, avg 2.71ms/call # spent 4µs making 21 calls to Class::MOP::Class::is_mutable, avg 200ns/call
2442145µs211.07ms map { $_->meta }
# spent 995µs making 9 calls to Class::MOP::Object::meta, avg 111µs/call # spent 16µs making 1 call to Moose::Meta::TypeCoercion::meta # spent 10µs making 2 calls to Moose::Meta::Role::Method::Required::meta, avg 5µs/call # spent 8µs making 1 call to Moose::Meta::Role::meta # spent 7µs making 1 call to Moose::Meta::TypeCoercion::Union::meta # spent 6µs making 1 call to Moose::Meta::Role::Application::RoleSummation::meta # spent 6µs making 1 call to Moose::Meta::Role::Application::ToRole::meta # spent 5µs making 1 call to Moose::Meta::Role::Composite::meta # spent 5µs making 1 call to Moose::Meta::Role::Application::ToClass::meta # spent 5µs making 1 call to Class::MOP::Mixin::meta # spent 5µs making 1 call to Moose::Meta::Role::Application::meta # spent 4µs making 1 call to Moose::Meta::Role::Application::ToInstance::meta
245 qw(
246 Moose::Meta::Attribute
247 Moose::Meta::Class
248 Moose::Meta::Instance
249
250 Moose::Meta::TypeCoercion
251 Moose::Meta::TypeCoercion::Union
252
253 Moose::Meta::Method
254 Moose::Meta::Method::Constructor
255 Moose::Meta::Method::Destructor
256 Moose::Meta::Method::Overridden
257 Moose::Meta::Method::Augmented
258
259 Moose::Meta::Role
260 Moose::Meta::Role::Attribute
261 Moose::Meta::Role::Method
262 Moose::Meta::Role::Method::Required
263 Moose::Meta::Role::Method::Conflicting
264
265 Moose::Meta::Role::Composite
266
267 Moose::Meta::Role::Application
268 Moose::Meta::Role::Application::RoleSummation
269 Moose::Meta::Role::Application::ToClass
270 Moose::Meta::Role::Application::ToRole
271 Moose::Meta::Role::Application::ToInstance
272);
273
274$_->make_immutable(
275 inline_constructor => 0,
276 constructor_name => undef,
277 # these are Class::MOP accessors, so they need inlining
278 inline_accessors => 1
27948µs68.23ms ) for grep { $_->is_mutable }
# spent 8.23ms making 3 calls to Class::MOP::Class::make_immutable, avg 2.74ms/call # spent 600ns making 3 calls to Class::MOP::Class::is_mutable, avg 200ns/call
280311µs3301µs map { $_->meta }
# spent 295µs making 2 calls to Class::MOP::Object::meta, avg 147µs/call # spent 7µs making 1 call to Class::MOP::Mixin::meta
281 qw(
282 Moose::Meta::Method::Accessor
283 Moose::Meta::Method::Delegation
284 Moose::Meta::Mixin::AttributeCore
285);
286
287111µs1;
288
289# ABSTRACT: A postmodern object system for Perl 5
290
291__END__