← 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 14:16:49 2016
Reported on Fri Jan 8 14:23:07 2016

Filename/usr/share/perl5/Moo/HandleMoose/_TypeMap.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11116µs53µsMoo::HandleMoose::_TypeMap::::BEGIN@2Moo::HandleMoose::_TypeMap::BEGIN@2
1119µs18µsMoo::HandleMoose::_TypeMap::::BEGIN@21Moo::HandleMoose::_TypeMap::BEGIN@21
1118µs16µsMoo::HandleMoose::_TypeMap::::BEGIN@11Moo::HandleMoose::_TypeMap::BEGIN@11
1115µs5µsMoo::HandleMoose::_TypeMap::::CLEARMoo::HandleMoose::_TypeMap::CLEAR
1115µs5µsMoo::HandleMoose::_TypeMap::::BEGIN@10Moo::HandleMoose::_TypeMap::BEGIN@10
1112µs2µsMoo::HandleMoose::_TypeMap::::TIEHASHMoo::HandleMoose::_TypeMap::TIEHASH
0000s0sMoo::HandleMoose::_TypeMap::::CLONEMoo::HandleMoose::_TypeMap::CLONE
0000s0sMoo::HandleMoose::_TypeMap::::DELETEMoo::HandleMoose::_TypeMap::DELETE
0000s0sMoo::HandleMoose::_TypeMap::::DESTROYMoo::HandleMoose::_TypeMap::DESTROY
0000s0sMoo::HandleMoose::_TypeMap::::EXISTSMoo::HandleMoose::_TypeMap::EXISTS
0000s0sMoo::HandleMoose::_TypeMap::::FETCHMoo::HandleMoose::_TypeMap::FETCH
0000s0sMoo::HandleMoose::_TypeMap::::FIRSTKEYMoo::HandleMoose::_TypeMap::FIRSTKEY
0000s0sMoo::HandleMoose::_TypeMap::::NEXTKEYMoo::HandleMoose::_TypeMap::NEXTKEY
0000s0sMoo::HandleMoose::_TypeMap::::SCALARMoo::HandleMoose::_TypeMap::SCALAR
0000s0sMoo::HandleMoose::_TypeMap::::STOREMoo::HandleMoose::_TypeMap::STORE
0000s0sMoo::HandleMoose::_TypeMap::::_str_to_refMoo::HandleMoose::_TypeMap::_str_to_ref
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moo::HandleMoose::_TypeMap;
2389µs
# spent 53µs (16+36) within Moo::HandleMoose::_TypeMap::BEGIN@2 which was called: # once (16µs+36µs) by Sub::Defer::BEGIN@5 at line 2
use strictures 1;
# spent 53µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@2 # spent 21µs making 1 call to strictures::import # spent 16µs making 1 call to strictures::VERSION
3
4package
5 Moo::HandleMoose;
6our %TYPE_MAP;
7
8package Moo::HandleMoose::_TypeMap;
9
1015µs
# spent 5µs within Moo::HandleMoose::_TypeMap::BEGIN@10 which was called: # once (5µs+0s) by Sub::Defer::BEGIN@5 at line 10
use Scalar::Util ();
# spent 5µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@10
11224µs
# spent 16µs (8+8) within Moo::HandleMoose::_TypeMap::BEGIN@11 which was called: # once (8µs+8µs) by Sub::Defer::BEGIN@5 at line 11
use Config;
# spent 16µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@11 # spent 8µs making 1 call to Config::import
12
13our %WEAK_TYPES;
14
15sub _str_to_ref {
16 my $in = shift;
17 return $in
18 if ref $in;
19
20 if ($in =~ /(?:^|=)[A-Z]+\(0x([0-9a-zA-Z]+)\)$/) {
21227µs
# spent 18µs (9+9) within Moo::HandleMoose::_TypeMap::BEGIN@21 which was called: # once (9µs+9µs) by Sub::Defer::BEGIN@5 at line 21
my $id = do { no warnings 'portable'; hex "$1" };
# spent 18µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@21 # spent 9µs making 1 call to warnings::unimport
22 require B;
23 my $sv = bless \$id, 'B::SV';
24 my $ref = eval { $sv->object_2svref };
25 if (!defined $ref) {
26 die <<'END_ERROR';
27Moo initialization encountered types defined in a parent thread - ensure that
28Moo is require()d before any further thread spawns following a type definition.
29END_ERROR
30 }
31 return $ref;
32 }
33 return $in;
34}
35
36
# spent 2µs within Moo::HandleMoose::_TypeMap::TIEHASH which was called: # once (2µs+0s) by Sub::Defer::BEGIN@5 at line 71
sub TIEHASH { bless {}, $_[0] }
37
38sub STORE {
39 my ($self, $key, $value) = @_;
40 my $type = _str_to_ref($key);
41 $WEAK_TYPES{$type} = $type;
42 Scalar::Util::weaken($WEAK_TYPES{$type})
43 if ref $type;
44 $self->{$key} = $value;
45}
46
47sub FETCH { $_[0]->{$_[1]} }
48sub FIRSTKEY { my $a = scalar keys %{$_[0]}; each %{$_[0]} }
49sub NEXTKEY { each %{$_[0]} }
50sub EXISTS { exists $_[0]->{$_[1]} }
51sub DELETE { delete $_[0]->{$_[1]} }
52
# spent 5µs within Moo::HandleMoose::_TypeMap::CLEAR which was called: # once (5µs+0s) by Sub::Defer::BEGIN@5 at line 72
sub CLEAR { %{$_[0]} = () }
53sub SCALAR { scalar %{$_[0]} }
54
55sub CLONE {
56 my @types = map {
57 defined $WEAK_TYPES{$_} ? ($WEAK_TYPES{$_} => $TYPE_MAP{$_}) : ()
58 } keys %TYPE_MAP;
59 %WEAK_TYPES = ();
60 %TYPE_MAP = @types;
61}
62
63sub DESTROY {
64 my %types = %{$_[0]};
65 untie %TYPE_MAP;
66 %TYPE_MAP = %types;
67}
68
6913µsif ($Config{useithreads}) {
# spent 3µs making 1 call to Config::FETCH
70 my @types = %TYPE_MAP;
7112µs tie %TYPE_MAP, __PACKAGE__;
# spent 2µs making 1 call to Moo::HandleMoose::_TypeMap::TIEHASH
7215µs %TYPE_MAP = @types;
# spent 5µs making 1 call to Moo::HandleMoose::_TypeMap::CLEAR
73}
74
751;