← 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/HandleMoose/_TypeMap.pm
StatementsExecuted 15 statements in 649µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11117µs68µsMoo::HandleMoose::_TypeMap::::BEGIN@2Moo::HandleMoose::_TypeMap::BEGIN@2
11114µs25µsMoo::HandleMoose::_TypeMap::::BEGIN@20Moo::HandleMoose::_TypeMap::BEGIN@20
1116µs6µsMoo::HandleMoose::_TypeMap::::CLEARMoo::HandleMoose::_TypeMap::CLEAR
1114µs4µsMoo::HandleMoose::_TypeMap::::BEGIN@10Moo::HandleMoose::_TypeMap::BEGIN@10
1113µs3µ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;
2352µs3118µs
# spent 68µs (17+51) within Moo::HandleMoose::_TypeMap::BEGIN@2 which was called: # once (17µs+51µs) by Moo::BEGIN@4 at line 2
use strictures 1;
# spent 68µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@2 # spent 35µs making 1 call to strictures::import # spent 15µs making 1 call to strictures::VERSION
3
4package
5 Moo::HandleMoose;
61300nsour %TYPE_MAP;
7
8package Moo::HandleMoose::_TypeMap;
9
10298µs14µs
# spent 4µs within Moo::HandleMoose::_TypeMap::BEGIN@10 which was called: # once (4µs+0s) by Moo::BEGIN@4 at line 10
use Scalar::Util ();
# spent 4µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@10
11
121100nsour %WEAK_TYPES;
13
14sub _str_to_ref {
15 my $in = shift;
16 return $in
17 if ref $in;
18
19 if ($in =~ /(?:^|=)[A-Z]+\(0x([0-9a-zA-Z]+)\)$/) {
202467µs236µs
# spent 25µs (14+11) within Moo::HandleMoose::_TypeMap::BEGIN@20 which was called: # once (14µs+11µs) by Moo::BEGIN@4 at line 20
my $id = do { no warnings 'portable'; hex "$1" };
# spent 25µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@20 # spent 11µs making 1 call to warnings::unimport
21 require B;
22 my $sv = bless \$id, 'B::SV';
23 my $ref = eval { $sv->object_2svref };
24 if (!defined $ref) {
25 die <<'END_ERROR';
26Moo initialization encountered types defined in a parent thread - ensure that
27Moo is require()d before any further thread spawns following a type definition.
28END_ERROR
29 }
30 return $ref;
31 }
32 return $in;
33}
34
3518µs
# spent 3µs within Moo::HandleMoose::_TypeMap::TIEHASH which was called: # once (3µs+0s) by Moo::BEGIN@4 at line 69
sub TIEHASH { bless {}, $_[0] }
36
37sub STORE {
38 my ($self, $key, $value) = @_;
39 my $type = _str_to_ref($key);
40 $WEAK_TYPES{$type} = $type;
41 Scalar::Util::weaken($WEAK_TYPES{$type})
42 if ref $type;
43 $self->{$key} = $value;
44}
45
46sub FETCH { $_[0]->{$_[1]} }
47sub FIRSTKEY { my $a = scalar keys %{$_[0]}; each %{$_[0]} }
48sub NEXTKEY { each %{$_[0]} }
49sub EXISTS { exists $_[0]->{$_[1]} }
50sub DELETE { delete $_[0]->{$_[1]} }
5118µs
# spent 6µs within Moo::HandleMoose::_TypeMap::CLEAR which was called: # once (6µs+0s) by Moo::BEGIN@4 at line 70
sub CLEAR { %{$_[0]} = () }
52sub SCALAR { scalar %{$_[0]} }
53
54sub CLONE {
55 my @types = map {
56 defined $WEAK_TYPES{$_} ? ($WEAK_TYPES{$_} => $TYPE_MAP{$_}) : ()
57 } keys %TYPE_MAP;
58 %WEAK_TYPES = ();
59 %TYPE_MAP = @types;
60}
61
62sub DESTROY {
63 my %types = %{$_[0]};
64 untie %TYPE_MAP;
65 %TYPE_MAP = %types;
66}
67
6811µsmy @types = %TYPE_MAP;
6915µs13µstie %TYPE_MAP, __PACKAGE__;
# spent 3µs making 1 call to Moo::HandleMoose::_TypeMap::TIEHASH
7014µs16µs%TYPE_MAP = @types;
# spent 6µs making 1 call to Moo::HandleMoose::_TypeMap::CLEAR
71
7215µs1;