← Index
NYTProf Performance Profile   « line view »
For starman worker -M FindBin --max-requests 50 --workers 2 --user=kohadev-koha --group kohadev-koha --pid /var/run/koha/kohadev/plack.pid --daemonize --access-log /var/log/koha/kohadev/plack.log --error-log /var/log/koha/kohadev/plack-error.log -E deployment --socket /var/run/koha/kohadev/plack.sock /etc/koha/sites/kohadev/plack.psgi
  Run on Fri Jan 8 13:01:18 2016
Reported on Fri Jan 8 13:01:34 2016

Filename/usr/share/perl5/Moo/_Utils.pm
StatementsExecuted 3338 statements in 12.4ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
547223.02ms8.50msMoo::_Utils::::_install_coderefMoo::_Utils::_install_coderef
584731.87ms1.87msMoo::_Utils::::_getglobMoo::_Utils::_getglob
547111.58ms3.68msMoo::_Utils::::_name_coderefMoo::_Utils::_name_coderef
111950µs1.23msMoo::_Utils::::BEGIN@14Moo::_Utils::BEGIN@14
111297µs427µsMoo::_Utils::::BEGIN@16Moo::_Utils::BEGIN@16
11144µs76µsMoo::_Utils::::BEGIN@15Moo::_Utils::BEGIN@15
11140µs88µsMoo::_Utils::::BEGIN@12Moo::_Utils::BEGIN@12
11128µs61µsMoo::_Utils::::BEGIN@82Moo::_Utils::BEGIN@82
11124µs87µsMoo::_Utils::::_maybe_load_moduleMoo::_Utils::_maybe_load_module
11122µs44µsMoo::_Utils::::BEGIN@3Moo::_Utils::BEGIN@3
11122µs115µsMoo::_Utils::::BEGIN@11Moo::_Utils::BEGIN@11
11121µs39µsMoo::_Utils::::BEGIN@112Moo::_Utils::BEGIN@112
11118µs76µsMoo::_Utils::::BEGIN@8Moo::_Utils::BEGIN@8
11117µs39µsMoo::_Utils::::BEGIN@17Moo::_Utils::BEGIN@17
11114µs40µsMoo::_Utils::::BEGIN@9Moo::_Utils::BEGIN@9
11113µs24µsMoo::_Utils::::BEGIN@89Moo::_Utils::BEGIN@89
21111µs43µsMoo::_Utils::::_set_loadedMoo::_Utils::_set_loaded
2114µs4µsMoo::_Utils::::_getstashMoo::_Utils::_getstash
0000s0sMoo::_Utils::::_get_linear_isaMoo::_Utils::_get_linear_isa
0000s0sMoo::_Utils::::_install_modifierMoo::_Utils::_install_modifier
0000s0sMoo::_Utils::::_load_moduleMoo::_Utils::_load_module
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
32191µs265µs
# spent 44µs (22+21) within Moo::_Utils::BEGIN@3 which was called: # once (22µs+21µs) by Sub::Defer::BEGIN@5 at line 3
no warnings 'once'; # guard against -w
# spent 44µs making 1 call to Moo::_Utils::BEGIN@3 # spent 21µs making 1 call to warnings::unimport
4
55842.42ms
# spent 1.87ms within Moo::_Utils::_getglob which was called 584 times, avg 3µs/call: # 547 times (1.80ms+0s) by Moo::_Utils::_install_coderef at line 81, avg 3µs/call # 14 times (30µs+0s) by Sub::Defer::undefer_sub at line 25 of Sub/Defer.pm, avg 2µs/call # 14 times (13µs+0s) by Sub::Defer::undefer_sub at line 30 of Sub/Defer.pm, avg 921ns/call # 6 times (20µs+0s) by Method::Generate::Accessor::generate_method at line 109 of Method/Generate/Accessor.pm, avg 3µs/call # once (5µs+0s) by Method::Generate::Accessor::generate_method at line 126 of Method/Generate/Accessor.pm # once (3µs+0s) by Method::Generate::Accessor::generate_method at line 146 of Method/Generate/Accessor.pm # once (2µs+0s) by Method::Generate::Accessor::generate_method at line 182 of Method/Generate/Accessor.pm
sub _getglob { \*{$_[0]} }
627µs
# spent 4µs within Moo::_Utils::_getstash which was called 2 times, avg 2µs/call: # 2 times (4µs+0s) by Moo::import at line 68 of Moo.pm, avg 2µs/call
sub _getstash { \%{"$_[0]::"} }
7
82119µs2134µs
# spent 76µs (18+58) within Moo::_Utils::BEGIN@8 which was called: # once (18µs+58µs) by Sub::Defer::BEGIN@5 at line 8
use constant lt_5_8_3 => ( $] < 5.008003 or $ENV{MOO_TEST_PRE_583} ) ? 1 : 0;
# spent 76µs making 1 call to Moo::_Utils::BEGIN@8 # spent 58µs making 1 call to constant::import
9380µs265µs
# spent 40µs (14+26) within Moo::_Utils::BEGIN@9 which was called: # once (14µs+26µs) by Sub::Defer::BEGIN@5 at line 9
use constant can_haz_subname => eval { require Sub::Name };
# spent 40µs making 1 call to Moo::_Utils::BEGIN@9 # spent 26µs making 1 call to constant::import
10
11368µs3208µs
# spent 115µs (22+93) within Moo::_Utils::BEGIN@11 which was called: # once (22µs+93µs) by Sub::Defer::BEGIN@5 at line 11
use strictures 1;
# spent 115µs making 1 call to Moo::_Utils::BEGIN@11 # spent 60µs making 1 call to strictures::import # spent 34µs making 1 call to strictures::VERSION
122125µs2137µs
# spent 88µs (40+48) within Moo::_Utils::BEGIN@12 which was called: # once (40µs+48µs) by Sub::Defer::BEGIN@5 at line 12
use Module::Runtime qw(use_package_optimistically module_notional_filename);
# spent 88µs making 1 call to Moo::_Utils::BEGIN@12 # spent 48µs making 1 call to Module::Runtime::import
13
142470µs11.23ms
# spent 1.23ms (950µs+278µs) within Moo::_Utils::BEGIN@14 which was called: # once (950µs+278µs) by Sub::Defer::BEGIN@5 at line 14
use Devel::GlobalDestruction ();
# spent 1.23ms making 1 call to Moo::_Utils::BEGIN@14
152104µs2109µs
# spent 76µs (44+33) within Moo::_Utils::BEGIN@15 which was called: # once (44µs+33µs) by Sub::Defer::BEGIN@5 at line 15
use Exporter qw(import);
# spent 76µs making 1 call to Moo::_Utils::BEGIN@15 # spent 33µs making 1 call to Exporter::import
162282µs1427µs
# spent 427µs (297+130) within Moo::_Utils::BEGIN@16 which was called: # once (297µs+130µs) by Sub::Defer::BEGIN@5 at line 16
use Moo::_mro;
# spent 427µs making 1 call to Moo::_Utils::BEGIN@16
172919µs260µs
# spent 39µs (17+22) within Moo::_Utils::BEGIN@17 which was called: # once (17µs+22µs) by Sub::Defer::BEGIN@5 at line 17
use Config;
# spent 39µs making 1 call to Moo::_Utils::BEGIN@17 # spent 22µs making 1 call to Config::import
18
1915µ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 ();
2619µs*_in_global_destruction = \&Devel::GlobalDestruction::in_global_destruction;
27
28sub _install_modifier {
29 my ($into, $type, $name, $code) = @_;
30
31 if (my $to_modify = $into->can($name)) { # CMM will throw for us if not
32 require Sub::Defer;
33 Sub::Defer::undefer_sub($to_modify);
34 }
35
36 Class::Method::Modifiers::install_modifier(@_);
37}
38
391500nsour %MAYBE_LOADED;
40
41sub _load_module {
42 my $module = $_[0];
43 my $file = module_notional_filename($module);
44 use_package_optimistically($module);
45 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 87µs (24+62) within Moo::_Utils::_maybe_load_module which was called: # once (24µs+62µs) by Method::Generate::Accessor::BEGIN@11 at line 17 of Method/Generate/Accessor.pm
sub _maybe_load_module {
6011µs my $module = $_[0];
611900ns return $MAYBE_LOADED{$module}
62 if exists $MAYBE_LOADED{$module};
63288µs262µs if(! eval { use_package_optimistically($module) }) {
# spent 51µs making 1 call to Module::Runtime::use_package_optimistically # spent 11µs making 1 call to Module::Runtime::module_notional_filename
64 warn "$module exists but failed to load with error: $@";
65 }
66 elsif ( $INC{module_notional_filename($module)} ) {
67 return $MAYBE_LOADED{$module} = 1;
68 }
69 return $MAYBE_LOADED{$module} = 0;
70}
71
72
# spent 43µs (11+32) within Moo::_Utils::_set_loaded which was called 2 times, avg 22µs/call: # 2 times (11µs+32µs) by Moo::import at line 23 of Moo.pm, avg 22µs/call
sub _set_loaded {
73245µs232µs $INC{Module::Runtime::module_notional_filename($_[0])} ||= $_[1];
# spent 32µs making 2 calls to Module::Runtime::module_notional_filename, avg 16µs/call
74}
75
76sub _get_linear_isa {
77 return mro::get_linear_isa($_[0]);
78}
79
80
# spent 8.50ms (3.02+5.48) within Moo::_Utils::_install_coderef which was called 547 times, avg 16µs/call: # 535 times (2.96ms+5.38ms) by Sub::Defer::defer_sub at line 61 of Sub/Defer.pm, avg 16µs/call # 12 times (61µs+96µs) by Moo::_install_tracked at line 17 of Moo.pm, avg 13µs/call
sub _install_coderef {
815471.26ms10945.48ms my ($glob, $code) = (_getglob($_[0]), _name_coderef(@_));
# spent 3.68ms making 547 calls to Moo::_Utils::_name_coderef, avg 7µs/call # spent 1.80ms making 547 calls to Moo::_Utils::_getglob, avg 3µs/call
822124µs294µs
# spent 61µs (28+33) within Moo::_Utils::BEGIN@82 which was called: # once (28µs+33µs) by Sub::Defer::BEGIN@5 at line 82
no warnings 'redefine';
# spent 61µs making 1 call to Moo::_Utils::BEGIN@82 # spent 33µs making 1 call to warnings::unimport
835471.06ms if (*{$glob}{CODE}) {
84 *{$glob} = $code;
85 }
86 # perl will sometimes warn about mismatched prototypes coming from the
87 # inheritance cache, so disable them if we aren't redefining a sub
88 else {
892350µs234µs
# spent 24µs (13+11) within Moo::_Utils::BEGIN@89 which was called: # once (13µs+11µs) by Sub::Defer::BEGIN@5 at line 89
no warnings 'prototype';
# spent 24µs making 1 call to Moo::_Utils::BEGIN@89 # spent 11µs making 1 call to warnings::unimport
90527282µs *{$glob} = $code;
91 }
92}
93
94
# spent 3.68ms (1.58+2.10) within Moo::_Utils::_name_coderef which was called 547 times, avg 7µs/call: # 547 times (1.58ms+2.10ms) by Moo::_Utils::_install_coderef at line 81, avg 7µs/call
sub _name_coderef {
95547168µs shift if @_ > 2; # three args is (target, name, sub)
965473.71ms5472.10ms can_haz_subname ? Sub::Name::subname(@_) : $_[1];
# spent 2.10ms making 547 calls to Sub::Name::subname, avg 4µs/call
97}
98
99sub _unimport_coderefs {
100 my ($target, $info) = @_;
101 return unless $info and my $exports = $info->{exports};
102 my %rev = reverse %$exports;
103 my $stash = _getstash($target);
104 foreach my $name (keys %$exports) {
105 if ($stash->{$name} and defined(&{$stash->{$name}})) {
106 if ($rev{$target->can($name)}) {
107 my $old = delete $stash->{$name};
108 my $full_name = join('::',$target,$name);
109 # Copy everything except the code slot back into place (e.g. $has)
110 foreach my $type (qw(SCALAR HASH ARRAY IO)) {
111 next unless defined(*{$old}{$type});
1122211µs257µs
# spent 39µs (21+18) within Moo::_Utils::BEGIN@112 which was called: # once (21µs+18µs) by Sub::Defer::BEGIN@5 at line 112
no strict 'refs';
# spent 39µs making 1 call to Moo::_Utils::BEGIN@112 # spent 18µs making 1 call to strict::unimport
113 *$full_name = *{$old}{$type};
114 }
115 }
116 }
117 }
118}
119
1201288µs19µsif ($Config{useithreads}) {
# spent 9µs making 1 call to Config::FETCH
121 require Moo::HandleMoose::_TypeMap;
122}
123
124111µs1;