← 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/x86_64-linux/Moose/Meta/Attribute/Native.pm
StatementsExecuted 38 statements in 169µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1118µs10µsMoose::::BEGIN@1.25 Moose::BEGIN@1.25
1116µs17µsMoose::Meta::Attribute::Native::::BEGIN@6Moose::Meta::Attribute::Native::BEGIN@6
1114µs7µsMoose::::BEGIN@2.26 Moose::BEGIN@2.26
0000s0sMoose::Meta::Attribute::Native::::__ANON__[:26]Moose::Meta::Attribute::Native::__ANON__[:26]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1213µs211µs
# spent 10µs (8+1) within Moose::BEGIN@1.25 which was called: # once (8µs+1µs) by Moose::BEGIN@43 at line 1
use strict;
# spent 10µs making 1 call to Moose::BEGIN@1.25 # spent 1µs making 1 call to strict::import
2228µs210µs
# spent 7µs (4+3) within Moose::BEGIN@2.26 which was called: # once (4µs+3µs) by Moose::BEGIN@43 at line 2
use warnings;
# spent 7µs making 1 call to Moose::BEGIN@2.26 # spent 3µs making 1 call to warnings::import
3package Moose::Meta::Attribute::Native;
41100nsour $VERSION = '2.1605';
5
6291µs229µs
# spent 17µs (6+12) within Moose::Meta::Attribute::Native::BEGIN@6 which was called: # once (6µs+12µs) by Moose::BEGIN@43 at line 6
use Module::Runtime 'require_module';
# spent 17µs making 1 call to Moose::Meta::Attribute::Native::BEGIN@6 # spent 12µs making 1 call to Module::Runtime::import
7
81800nsmy @trait_names = qw(Bool Counter Number String Array Hash Code);
9
101400nsfor my $trait_name (@trait_names) {
1173µs my $trait_class = "Moose::Meta::Attribute::Native::Trait::$trait_name";
1277µs7246µs my $meta = Class::MOP::Class->initialize(
# spent 246µs making 7 calls to Class::MOP::Class::initialize, avg 35µs/call
13 "Moose::Meta::Attribute::Custom::Trait::$trait_name"
14 );
15
1675µs7245µs if ($meta->find_method_by_name('register_implementation')) {
# spent 245µs making 7 calls to Class::MOP::Class::find_method_by_name, avg 35µs/call
17 my $class = $meta->name->register_implementation;
18 die "An implementation for $trait_name already exists " .
19 "(found '$class' when trying to register '$trait_class')"
20 }
21 $meta->add_method(register_implementation => sub {
22 # resolve_metatrait_alias will load classes anyway, but throws away
23 # their error message; we WANT to die if there's a problem
24 require_module($trait_class);
25 return $trait_class;
26714µs7182µs });
# spent 182µs making 7 calls to Class::MOP::Mixin::HasMethods::add_method, avg 26µs/call
27}
28
2915µs1;
30
31# ABSTRACT: Delegate to native Perl types
32
33__END__