← Index
NYTProf Performance Profile   « line view »
For flows_to_es.pl
  Run on Mon May 9 23:27:59 2016
Reported on Mon May 9 23:28:08 2016

Filename/usr/share/perl5/Moo/_Utils.pm
StatementsExecuted 1150 statements in 5.20ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.56ms1.67msMoo::_Utils::::BEGIN@12Moo::_Utils::BEGIN@12
111939µs1.94msMoo::_Utils::::_maybe_load_moduleMoo::_Utils::_maybe_load_module
19433913µs2.35msMoo::_Utils::::_install_coderefMoo::_Utils::_install_coderef
344115910µs910µsMoo::_Utils::::_getglobMoo::_Utils::_getglob
19411559µs962µsMoo::_Utils::::_name_coderefMoo::_Utils::_name_coderef
111420µs587µsMoo::_Utils::::BEGIN@16Moo::_Utils::BEGIN@16
111328µs1.57msMoo::_Utils::::BEGIN@14Moo::_Utils::BEGIN@14
2911180µs68.8msMoo::_Utils::::_load_moduleMoo::_Utils::_load_module (recurses: max depth 1, inclusive time 7.66ms)
252298µs792µsMoo::_Utils::::_set_loadedMoo::_Utils::_set_loaded
252267µs67µsMoo::_Utils::::_getstashMoo::_Utils::_getstash
41154µs1.06msMoo::_Utils::::_install_modifierMoo::_Utils::_install_modifier
11114µs23µsMoo::_Utils::::BEGIN@3Moo::_Utils::BEGIN@3
11112µs59µsMoo::_Utils::::BEGIN@11Moo::_Utils::BEGIN@11
11111µs22µsMoo::_Utils::::BEGIN@83Moo::_Utils::BEGIN@83
21110µs22µsMoo::_Utils::::_get_linear_isaMoo::_Utils::_get_linear_isa
11110µs20µsMoo::_Utils::::BEGIN@17Moo::_Utils::BEGIN@17
11110µs42µsMoo::_Utils::::BEGIN@8Moo::_Utils::BEGIN@8
1119µs72µsMoo::_Utils::::BEGIN@15Moo::_Utils::BEGIN@15
1119µs21µsMoo::_Utils::::BEGIN@105Moo::_Utils::BEGIN@105
1118µs48µsMoo::_Utils::::BEGIN@9Moo::_Utils::BEGIN@9
1114µs4µsMoo::_Utils::::CORE:substMoo::_Utils::CORE:subst (opcode)
0000s0sMoo::_Utils::::_unimport_coderefsMoo::_Utils::_unimport_coderefs
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moo::_Utils;
2
3297µs232µs
# spent 23µs (14+9) within Moo::_Utils::BEGIN@3 which was called: # once (14µs+9µs) by Moo::BEGIN@4 at line 3
no warnings 'once'; # guard against -w
# spent 23µs making 1 call to Moo::_Utils::BEGIN@3 # spent 9µs making 1 call to warnings::unimport
4
53441.25ms
# spent 910µs within Moo::_Utils::_getglob which was called 344 times, avg 3µs/call: # 194 times (478µs+0s) by Moo::_Utils::_install_coderef at line 84, avg 2µs/call # 62 times (208µs+0s) by Method::Generate::Accessor::generate_method at line 108 of Method/Generate/Accessor.pm, avg 3µs/call # 18 times (57µs+0s) by Sub::Defer::undefer_sub at line 25 of Sub/Defer.pm, avg 3µs/call # 18 times (54µs+0s) by Method::Generate::Accessor::generate_method at line 204 of Method/Generate/Accessor.pm, avg 3µs/call # 18 times (25µs+0s) by Sub::Defer::undefer_sub at line 30 of Sub/Defer.pm, avg 1µs/call # 14 times (32µs+0s) by Moo::Role::import at line 73 of Moo/Role.pm, avg 2µs/call # 12 times (38µs+0s) by Method::Generate::Accessor::generate_method at line 125 of Method/Generate/Accessor.pm, avg 3µs/call # 4 times (8µs+0s) by Method::Generate::BuildAll::buildall_body_for at line 27 of Method/Generate/BuildAll.pm, avg 2µs/call # 2 times (5µs+0s) by Method::Generate::Accessor::generate_method at line 145 of Method/Generate/Accessor.pm, avg 3µs/call # once (3µs+0s) by Method::Generate::Accessor::generate_method at line 164 of Method/Generate/Accessor.pm # once (2µs+0s) by Method::Generate::Accessor::generate_method at line 181 of Method/Generate/Accessor.pm
sub _getglob { \*{$_[0]} }
62591µs
# spent 67µs within Moo::_Utils::_getstash which was called 25 times, avg 3µs/call: # 14 times (44µs+0s) by Moo::Role::import at line 35 of Moo/Role.pm, avg 3µs/call # 11 times (23µs+0s) by Moo::import at line 70 of Moo.pm, avg 2µs/call
sub _getstash { \%{"$_[0]::"} }
7
8242µs275µs
# spent 42µs (10+32) within Moo::_Utils::BEGIN@8 which was called: # once (10µs+32µs) by Moo::BEGIN@4 at line 8
use constant lt_5_8_3 => ( $] < 5.008003 or $ENV{MOO_TEST_PRE_583} ) ? 1 : 0;
# spent 42µs making 1 call to Moo::_Utils::BEGIN@8 # spent 32µs making 1 call to constant::import
9336µs288µs
# spent 48µs (8+40) within Moo::_Utils::BEGIN@9 which was called: # once (8µs+40µs) by Moo::BEGIN@4 at line 9
use constant can_haz_subname => eval { require Sub::Name };
# spent 48µs making 1 call to Moo::_Utils::BEGIN@9 # spent 40µs making 1 call to constant::import
10
11338µs3106µs
# spent 59µs (12+47) within Moo::_Utils::BEGIN@11 which was called: # once (12µs+47µs) by Moo::BEGIN@4 at line 11
use strictures 1;
# spent 59µs making 1 call to Moo::_Utils::BEGIN@11 # spent 33µs making 1 call to strictures::import # spent 14µs making 1 call to strictures::VERSION
122193µs21.70ms
# spent 1.67ms (1.56+114µs) within Moo::_Utils::BEGIN@12 which was called: # once (1.56ms+114µs) by Moo::BEGIN@4 at line 12
use Module::Runtime qw(use_package_optimistically module_notional_filename);
# spent 1.67ms making 1 call to Moo::_Utils::BEGIN@12 # spent 23µs making 1 call to Module::Runtime::import
13
142115µs11.57ms
# spent 1.57ms (328µs+1.24) within Moo::_Utils::BEGIN@14 which was called: # once (328µs+1.24ms) by Moo::BEGIN@4 at line 14
use Devel::GlobalDestruction ();
# spent 1.57ms making 1 call to Moo::_Utils::BEGIN@14
15231µs2135µs
# spent 72µs (9+63) within Moo::_Utils::BEGIN@15 which was called: # once (9µs+63µs) by Moo::BEGIN@4 at line 15
use base qw(Exporter);
# spent 72µs making 1 call to Moo::_Utils::BEGIN@15 # spent 63µs making 1 call to base::import
162126µs1587µs
# spent 587µs (420+167) within Moo::_Utils::BEGIN@16 which was called: # once (420µs+167µs) by Moo::BEGIN@4 at line 16
use Moo::_mro;
# spent 587µs making 1 call to Moo::_Utils::BEGIN@16
172495µs230µs
# spent 20µs (10+10) within Moo::_Utils::BEGIN@17 which was called: # once (10µs+10µs) by Moo::BEGIN@4 at line 17
use Config;
# spent 20µs making 1 call to Moo::_Utils::BEGIN@17 # spent 10µs making 1 call to Config::import
18
1913µsour @EXPORT = qw(
20 _getglob _install_modifier _load_module _maybe_load_module
21 _get_linear_isa _getstash _install_coderef _name_coderef
22 _unimport_coderefs _in_global_destruction _set_loaded
23);
24
25sub _in_global_destruction ();
2613µs*_in_global_destruction = \&Devel::GlobalDestruction::in_global_destruction;
27
28
# spent 1.06ms (54µs+1.00) within Moo::_Utils::_install_modifier which was called 4 times, avg 264µs/call: # 4 times (54µs+1.00ms) by Moo::Role::_install_single_modifier at line 340 of Moo/Role.pm, avg 264µs/call
sub _install_modifier {
2942µs my ($into, $type, $name, $code) = @_;
30
31426µs48µs if (my $to_modify = $into->can($name)) { # CMM will throw for us if not
# spent 8µs making 4 calls to UNIVERSAL::can, avg 2µs/call
3242µs require Sub::Defer;
3345µs4305µs Sub::Defer::undefer_sub($to_modify);
# spent 305µs making 4 calls to Sub::Defer::undefer_sub, avg 76µs/call
34 }
35
36414µs4688µs Class::Method::Modifiers::install_modifier(@_);
# spent 688µs making 4 calls to Class::Method::Modifiers::install_modifier, avg 172µs/call
37}
38
391100nsour %MAYBE_LOADED;
40
41
# spent 68.8ms (180µs+68.6) within Moo::_Utils::_load_module which was called 29 times, avg 2.37ms/call: # 29 times (180µs+68.6ms) by Moo::Role::_inhale_if_moose at line 116 of Moo/Role.pm, avg 2.37ms/call
sub _load_module {
422910µs my $module = $_[0];
432934µs29768µs my $file = module_notional_filename($module);
# spent 768µs making 29 calls to Module::Runtime::module_notional_filename, avg 26µs/call
442938µs2968.0ms use_package_optimistically($module);
# spent 75.5ms making 29 calls to Module::Runtime::use_package_optimistically, avg 2.60ms/call, recursion: max depth 1, sum of overlapping time 7.47ms
452971µs return 1
46 if $INC{$file};
47 my $error = $@ || "Can't locate $file";
48
49 # can't just ->can('can') because a sub-package Foo::Bar::Baz
50 # creates a 'Baz::' key in Foo::Bar's symbol table
51 my $stash = _getstash($module)||{};
52 return 1 if grep +(!ref($_) and *$_{CODE}), values %$stash;
53 return 1
54 if $INC{"Moose.pm"} && Class::MOP::class_of($module)
55 or Mouse::Util->can('find_meta') && Mouse::Util::find_meta($module);
56 die $error;
57}
58
59
# spent 1.94ms (939µs+1.00) within Moo::_Utils::_maybe_load_module which was called: # once (939µs+1.00ms) by Method::Generate::Accessor::BEGIN@11 at line 17 of Method/Generate/Accessor.pm
sub _maybe_load_module {
601700ns return $MAYBE_LOADED{$_[0]} if exists $MAYBE_LOADED{$_[0]};
61111µs14µs (my $proto = $_[0]) =~ s/::/\//g;
# spent 4µs making 1 call to Moo::_Utils::CORE:subst
6211µs local $@;
63391µs if (eval { require "${proto}.pm"; 1 }) {
64 $MAYBE_LOADED{$_[0]} = 1;
65 } else {
66 if (exists $INC{"${proto}.pm"}) {
67 warn "$_[0] exists but failed to load with error: $@";
68 }
69 $MAYBE_LOADED{$_[0]} = 0;
70 }
7116µs return $MAYBE_LOADED{$_[0]};
72}
73
74
# spent 792µs (98+694) within Moo::_Utils::_set_loaded which was called 25 times, avg 32µs/call: # 14 times (50µs+368µs) by Moo::Role::import at line 28 of Moo/Role.pm, avg 30µs/call # 11 times (48µs+326µs) by Moo::import at line 25 of Moo.pm, avg 34µs/call
sub _set_loaded {
752592µs25694µs $INC{Module::Runtime::module_notional_filename($_[0])} ||= $_[1];
# spent 694µs making 25 calls to Module::Runtime::module_notional_filename, avg 28µs/call
76}
77
78
# spent 22µs (10+11) within Moo::_Utils::_get_linear_isa which was called 2 times, avg 11µs/call: # 2 times (10µs+11µs) by Method::Generate::BuildAll::buildall_body_for at line 30 of Method/Generate/BuildAll.pm, avg 11µs/call
sub _get_linear_isa {
79224µs211µs return mro::get_linear_isa($_[0]);
# spent 11µs making 2 calls to mro::get_linear_isa, avg 6µs/call
80}
81
82
# spent 2.35ms (913µs+1.44) within Moo::_Utils::_install_coderef which was called 194 times, avg 12µs/call: # 84 times (375µs+618µs) by Moo::Role::_install_tracked at line 22 of Moo/Role.pm, avg 12µs/call # 66 times (305µs+478µs) by Moo::_install_tracked at line 19 of Moo.pm, avg 12µs/call # 44 times (233µs+344µs) by Sub::Defer::defer_sub at line 57 of Sub/Defer.pm, avg 13µs/call
sub _install_coderef {
832220µs233µs
# spent 22µs (11+11) within Moo::_Utils::BEGIN@83 which was called: # once (11µs+11µs) by Moo::BEGIN@4 at line 83
no warnings 'redefine';
# spent 22µs making 1 call to Moo::_Utils::BEGIN@83 # spent 11µs making 1 call to warnings::unimport
84194712µs3881.44ms *{_getglob($_[0])} = _name_coderef(@_);
# spent 962µs making 194 calls to Moo::_Utils::_name_coderef, avg 5µs/call # spent 478µs making 194 calls to Moo::_Utils::_getglob, avg 2µs/call
85}
86
87
# spent 962µs (559+403) within Moo::_Utils::_name_coderef which was called 194 times, avg 5µs/call: # 194 times (559µs+403µs) by Moo::_Utils::_install_coderef at line 84, avg 5µs/call
sub _name_coderef {
8819456µs shift if @_ > 2; # three args is (target, name, sub)
891941.08ms194403µs can_haz_subname ? Sub::Name::subname(@_) : $_[1];
# spent 403µs making 194 calls to Sub::Name::subname, avg 2µs/call
90}
91
92sub _unimport_coderefs {
93 my ($target, $info) = @_;
94 return unless $info and my $exports = $info->{exports};
95 my %rev = reverse %$exports;
96 my $stash = _getstash($target);
97 foreach my $name (keys %$exports) {
98 if ($stash->{$name} and defined(&{$stash->{$name}})) {
99 if ($rev{$target->can($name)}) {
100 my $old = delete $stash->{$name};
101 my $full_name = join('::',$target,$name);
102 # Copy everything except the code slot back into place (e.g. $has)
103 foreach my $type (qw(SCALAR HASH ARRAY IO)) {
104 next unless defined(*{$old}{$type});
105297µs234µs
# spent 21µs (9+12) within Moo::_Utils::BEGIN@105 which was called: # once (9µs+12µs) by Moo::BEGIN@4 at line 105
no strict 'refs';
# spent 21µs making 1 call to Moo::_Utils::BEGIN@105 # spent 12µs making 1 call to strict::unimport
106 *$full_name = *{$old}{$type};
107 }
108 }
109 }
110 }
111}
112
113190µs14µsif ($Config{useithreads}) {
# spent 4µs making 1 call to Config::FETCH
114 require Moo::HandleMoose::_TypeMap;
115}
116
11715µs1;
 
# spent 4µs within Moo::_Utils::CORE:subst which was called: # once (4µs+0s) by Moo::_Utils::_maybe_load_module at line 61
sub Moo::_Utils::CORE:subst; # opcode