← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:11 2016

Filename/usr/local/lib/perl/5.18.2/Moose/Meta/Attribute/Native.pm
StatementsExecuted 42 statements in 251µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1119µs18µsMoose::::BEGIN@1 Moose::BEGIN@1
1117µs22µsMoose::Meta::Attribute::Native::::BEGIN@6Moose::Meta::Attribute::Native::BEGIN@6
1116µs9µsMoose::::BEGIN@2 Moose::BEGIN@2
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
1219µs228µs
# spent 18µs (9+9) within Moose::BEGIN@1 which was called: # once (9µs+9µs) by Moose::BEGIN@43 at line 1
use strict;
# spent 18µs making 1 call to Moose::BEGIN@1 # spent 9µs making 1 call to strict::import
2245µs213µs
# spent 9µs (6+3) within Moose::BEGIN@2 which was called: # once (6µs+3µs) by Moose::BEGIN@43 at line 2
use warnings;
# spent 9µs making 1 call to Moose::BEGIN@2 # spent 3µs making 1 call to warnings::import
3package Moose::Meta::Attribute::Native;
41400nsour $VERSION = '2.1604';
5
62127µs237µs
# spent 22µs (7+15) within Moose::Meta::Attribute::Native::BEGIN@6 which was called: # once (7µs+15µs) by Moose::BEGIN@43 at line 6
use Module::Runtime 'require_module';
# spent 22µs making 1 call to Moose::Meta::Attribute::Native::BEGIN@6 # spent 15µs making 1 call to Module::Runtime::import
7
811µsmy @trait_names = qw(Bool Counter Number String Array Hash Code);
9
101600nsfor my $trait_name (@trait_names) {
1173µs my $trait_class = "Moose::Meta::Attribute::Native::Trait::$trait_name";
1278µs7359µs my $meta = Class::MOP::Class->initialize(
# spent 359µs making 7 calls to Class::MOP::Class::initialize, avg 51µs/call
13 "Moose::Meta::Attribute::Custom::Trait::$trait_name"
14 );
15
1676µs7384µs if ($meta->find_method_by_name('register_implementation')) {
# spent 384µs making 7 calls to Class::MOP::Class::find_method_by_name, avg 55µ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
2423µs20s require_module($trait_class);
# spent 22.9ms making 2 calls to Module::Runtime::require_module, avg 11.5ms/call, recursion: max depth 1, sum of overlapping time 22.9ms
2528µs return $trait_class;
26721µs7278µs });
# spent 278µs making 7 calls to Class::MOP::Mixin::HasMethods::add_method, avg 40µs/call
27}
28
2917µs1;
30
31# ABSTRACT: Delegate to native Perl types
32
33__END__