Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/YAML/Syck.pm |
Statements | Executed 44 statements in 2.41ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 2 | 1 | 463µs | 463µs | LoadYAML (xsub) | YAML::Syck::
1 | 1 | 1 | 51µs | 594µs | LoadFile | YAML::Syck::
1 | 1 | 1 | 36µs | 89µs | BEGIN@36 | YAML::Syck::
1 | 1 | 1 | 32µs | 32µs | CORE:open (opcode) | YAML::Syck::
2 | 2 | 2 | 24µs | 486µs | Load | YAML::Syck::
1 | 1 | 1 | 22µs | 259µs | BEGIN@15 | YAML::Syck::
1 | 1 | 1 | 14µs | 14µs | BEGIN@12 | YAML::Syck::
1 | 1 | 1 | 14µs | 14µs | CORE:ftis (opcode) | YAML::Syck::
1 | 1 | 1 | 12µs | 12µs | CORE:readline (opcode) | YAML::Syck::
1 | 1 | 1 | 11µs | 13µs | BEGIN@4 | YAML::Syck::
1 | 1 | 1 | 10µs | 12µs | _is_glob | YAML::Syck::
1 | 1 | 1 | 7µs | 20µs | BEGIN@13 | YAML::Syck::
1 | 1 | 1 | 7µs | 149µs | BEGIN@5 | YAML::Syck::
1 | 1 | 1 | 2µs | 2µs | CORE:ftzero (opcode) | YAML::Syck::
1 | 1 | 1 | 1µs | 1µs | CORE:match (opcode) | YAML::Syck::
0 | 0 | 0 | 0s | 0s | Dump | YAML::Syck::
0 | 0 | 0 | 0s | 0s | DumpFile | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:37] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:38] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:39] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:40] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:41] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:42] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:43] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:44] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:45] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:46] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:47] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:48] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:49] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:50] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:51] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __ANON__[:52] | YAML::Syck::
0 | 0 | 0 | 0s | 0s | __qr_helper | YAML::Syck::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package YAML::Syck; | ||||
2 | # See documentation after the __END__ mark. | ||||
3 | |||||
4 | 3 | 29µs | 2 | 15µs | # spent 13µs (11+2) within YAML::Syck::BEGIN@4 which was called:
# once (11µs+2µs) by Tapper::Config::BEGIN@15 at line 4 # spent 13µs making 1 call to YAML::Syck::BEGIN@4
# spent 2µs making 1 call to strict::import |
5 | 1 | 5µs | 1 | 142µs | # spent 149µs (7+142) within YAML::Syck::BEGIN@5 which was called:
# once (7µs+142µs) by Tapper::Config::BEGIN@15 at line 11 # spent 142µs making 1 call to vars::import |
6 | @ISA @EXPORT $VERSION | ||||
7 | $Headless $SortKeys $SingleQuote | ||||
8 | $ImplicitBinary $ImplicitTyping $ImplicitUnicode | ||||
9 | $UseCode $LoadCode $DumpCode | ||||
10 | $DeparseObject $LoadBlessed | ||||
11 | 2 | 14µs | 1 | 149µs | ); # spent 149µs making 1 call to YAML::Syck::BEGIN@5 |
12 | 3 | 27µs | 1 | 14µs | # spent 14µs within YAML::Syck::BEGIN@12 which was called:
# once (14µs+0s) by Tapper::Config::BEGIN@15 at line 12 # spent 14µs making 1 call to YAML::Syck::BEGIN@12 |
13 | 3 | 81µs | 2 | 33µs | # spent 20µs (7+13) within YAML::Syck::BEGIN@13 which was called:
# once (7µs+13µs) by Tapper::Config::BEGIN@15 at line 13 # spent 20µs making 1 call to YAML::Syck::BEGIN@13
# spent 13µs making 1 call to Exporter::import |
14 | |||||
15 | # spent 259µs (22+238) within YAML::Syck::BEGIN@15 which was called:
# once (22µs+238µs) by Tapper::Config::BEGIN@15 at line 34 | ||||
16 | 1 | 400ns | $VERSION = '1.20'; | ||
17 | 1 | 1µs | @EXPORT = qw( Dump Load DumpFile LoadFile ); | ||
18 | 1 | 9µs | @ISA = qw( Exporter ); | ||
19 | |||||
20 | 1 | 300ns | $SortKeys = 1; | ||
21 | 1 | 200ns | $LoadBlessed = 1; | ||
22 | |||||
23 | 1 | 200ns | local $@; | ||
24 | eval { | ||||
25 | 1 | 600ns | require XSLoader; | ||
26 | 1 | 243µs | 1 | 238µs | XSLoader::load(__PACKAGE__, $VERSION); # spent 238µs making 1 call to XSLoader::load |
27 | 1 | 900ns | 1; | ||
28 | 1 | 3µs | } or do { | ||
29 | require DynaLoader; | ||||
30 | push @ISA, 'DynaLoader'; | ||||
31 | __PACKAGE__->bootstrap($VERSION); | ||||
32 | }; | ||||
33 | |||||
34 | 1 | 289µs | 1 | 259µs | } # spent 259µs making 1 call to YAML::Syck::BEGIN@15 |
35 | |||||
36 | # spent 89µs (36+53) within YAML::Syck::BEGIN@36 which was called:
# once (36µs+53µs) by Tapper::Config::BEGIN@15 at line 53 | ||||
37 | '' => sub { qr{$_[0]} }, | ||||
38 | x => sub { qr{$_[0]}x }, | ||||
39 | i => sub { qr{$_[0]}i }, | ||||
40 | s => sub { qr{$_[0]}s }, | ||||
41 | m => sub { qr{$_[0]}m }, | ||||
42 | ix => sub { qr{$_[0]}ix }, | ||||
43 | sx => sub { qr{$_[0]}sx }, | ||||
44 | mx => sub { qr{$_[0]}mx }, | ||||
45 | si => sub { qr{$_[0]}si }, | ||||
46 | mi => sub { qr{$_[0]}mi }, | ||||
47 | ms => sub { qr{$_[0]}sm }, | ||||
48 | six => sub { qr{$_[0]}six }, | ||||
49 | mix => sub { qr{$_[0]}mix }, | ||||
50 | msx => sub { qr{$_[0]}msx }, | ||||
51 | msi => sub { qr{$_[0]}msi }, | ||||
52 | msix => sub { qr{$_[0]}msix }, | ||||
53 | 3 | 436µs | 2 | 142µs | }; # spent 89µs making 1 call to YAML::Syck::BEGIN@36
# spent 53µs making 1 call to constant::import |
54 | |||||
55 | sub __qr_helper { | ||||
56 | if ($_[0] =~ /\A \(\? ([ixsm]*) (?:- (?:[ixsm]*))? : (.*) \) \z/x) { | ||||
57 | my $sub = QR_MAP()->{$1} || QR_MAP()->{''}; | ||||
58 | &$sub($2); | ||||
59 | } | ||||
60 | else { | ||||
61 | qr/$_[0]/; | ||||
62 | } | ||||
63 | } | ||||
64 | |||||
65 | sub Dump { | ||||
66 | $#_ ? join('', map { YAML::Syck::DumpYAML($_) } @_) | ||||
67 | : YAML::Syck::DumpYAML($_[0]); | ||||
68 | } | ||||
69 | |||||
70 | # spent 486µs (24+462) within YAML::Syck::Load which was called 2 times, avg 243µs/call:
# once (10µs+462µs) by YAML::Syck::LoadFile at line 123
# once (15µs+0s) by Tapper::Config::_switch_context at line 72 of Tapper/Config.pm | ||||
71 | 2 | 4µs | if (wantarray) { | ||
72 | 1 | 468µs | 1 | 462µs | my ($rv) = YAML::Syck::LoadYAML($_[0]); # spent 462µs making 1 call to YAML::Syck::LoadYAML |
73 | 1 | 900ns | @{$rv}; | ||
74 | } | ||||
75 | else { | ||||
76 | 1 | 10µs | @_ = $_[0]; | ||
77 | 1 | 659µs | 1 | 1µs | goto &YAML::Syck::LoadYAML; # spent 1µs making 1 call to YAML::Syck::LoadYAML |
78 | } | ||||
79 | } | ||||
80 | |||||
81 | # spent 12µs (10+1) within YAML::Syck::_is_glob which was called:
# once (10µs+1µs) by YAML::Syck::LoadFile at line 115 | ||||
82 | 1 | 600ns | my $h = shift; | ||
83 | |||||
84 | 1 | 1µs | return 1 if(ref($h) eq 'GLOB'); | ||
85 | 1 | 1µs | return 1 if(ref(\$h) eq 'GLOB'); | ||
86 | 1 | 6µs | 1 | 1µs | return 1 if(ref($h) =~ m/^IO::/); # spent 1µs making 1 call to YAML::Syck::CORE:match |
87 | |||||
88 | 1 | 4µs | return; | ||
89 | } | ||||
90 | |||||
91 | sub DumpFile { | ||||
92 | my $file = shift; | ||||
93 | if ( _is_glob($file) ) { | ||||
94 | if ($#_) { | ||||
95 | print {$file} YAML::Syck::DumpYAML($_) for @_; | ||||
96 | } | ||||
97 | else { | ||||
98 | print {$file} YAML::Syck::DumpYAML($_[0]); | ||||
99 | } | ||||
100 | } | ||||
101 | else { | ||||
102 | open(my $fh, '>', $file) or die "Cannot write to $file: $!"; | ||||
103 | if ($#_) { | ||||
104 | print {$fh} YAML::Syck::DumpYAML($_) for @_; | ||||
105 | } | ||||
106 | else { | ||||
107 | print {$fh} YAML::Syck::DumpYAML($_[0]); | ||||
108 | } | ||||
109 | close $fh; | ||||
110 | } | ||||
111 | } | ||||
112 | |||||
113 | # spent 594µs (51+543) within YAML::Syck::LoadFile which was called:
# once (51µs+543µs) by Test::Fixture::DBIC::Schema::_load_fixture at line 36 of Test/Fixture/DBIC/Schema.pm | ||||
114 | 1 | 600ns | my $file = shift; | ||
115 | 1 | 5µs | 1 | 12µs | if ( _is_glob($file) ) { # spent 12µs making 1 call to YAML::Syck::_is_glob |
116 | Load(do { local $/; <$file> }); | ||||
117 | } | ||||
118 | else { | ||||
119 | 1 | 27µs | 2 | 16µs | if(!-e $file || -z $file) { # spent 14µs making 1 call to YAML::Syck::CORE:ftis
# spent 2µs making 1 call to YAML::Syck::CORE:ftzero |
120 | die("'$file' is empty or non-existant"); | ||||
121 | } | ||||
122 | 1 | 40µs | 1 | 32µs | open(my $fh, '<', $file) or die "Cannot read from $file: $!"; # spent 32µs making 1 call to YAML::Syck::CORE:open |
123 | 3 | 37µs | 2 | 483µs | Load(do { local $/; <$fh> }); # spent 471µs making 1 call to YAML::Syck::Load
# spent 12µs making 1 call to YAML::Syck::CORE:readline |
124 | } | ||||
125 | } | ||||
126 | |||||
127 | 1 | 3µs | 1; | ||
128 | |||||
129 | __END__ | ||||
# spent 14µs within YAML::Syck::CORE:ftis which was called:
# once (14µs+0s) by YAML::Syck::LoadFile at line 119 | |||||
# spent 2µs within YAML::Syck::CORE:ftzero which was called:
# once (2µs+0s) by YAML::Syck::LoadFile at line 119 | |||||
# spent 1µs within YAML::Syck::CORE:match which was called:
# once (1µs+0s) by YAML::Syck::_is_glob at line 86 | |||||
# spent 32µs within YAML::Syck::CORE:open which was called:
# once (32µs+0s) by YAML::Syck::LoadFile at line 122 | |||||
# spent 12µs within YAML::Syck::CORE:readline which was called:
# once (12µs+0s) by YAML::Syck::LoadFile at line 123 | |||||
sub YAML::Syck::LoadYAML; # xsub |