← Index
NYTProf Performance Profile   « line view »
For rbm/rbm
  Run on Wed Feb 12 20:36:06 2020
Reported on Wed Feb 12 21:42:25 2020

Filename/usr/lib/x86_64-linux-gnu/perl5/5.28/YAML/XS.pm
StatementsExecuted 1028 statements in 14.4ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
144112.03ms12.7msYAML::XS::::LoadFileYAML::XS::LoadFile
1111.32ms1.41msYAML::XS::::BEGIN@6YAML::XS::BEGIN@6
14411905µs905µsYAML::XS::::CORE:openYAML::XS::CORE:open (opcode)
111872µs1.18msYAML::XS::::BEGIN@21YAML::XS::BEGIN@21
14411859µs859µsYAML::XS::::CORE:readlineYAML::XS::CORE:readline (opcode)
111268µs634µsYAML::XS::::BEGIN@20YAML::XS::BEGIN@20
11126µs79µsYAML::XS::::BEGIN@99YAML::XS::BEGIN@99
1119µs11µsRBM::::BEGIN@1.2 RBM::BEGIN@1.2
1115µs18µsRBM::::BEGIN@1.3 RBM::BEGIN@1.3
0000s0sYAML::XS::::DumpFileYAML::XS::DumpFile
0000s0sYAML::XS::::__ANON__[:100]YAML::XS::__ANON__[:100]
0000s0sYAML::XS::::__ANON__[:101]YAML::XS::__ANON__[:101]
0000s0sYAML::XS::::__ANON__[:102]YAML::XS::__ANON__[:102]
0000s0sYAML::XS::::__ANON__[:103]YAML::XS::__ANON__[:103]
0000s0sYAML::XS::::__ANON__[:104]YAML::XS::__ANON__[:104]
0000s0sYAML::XS::::__ANON__[:105]YAML::XS::__ANON__[:105]
0000s0sYAML::XS::::__ANON__[:106]YAML::XS::__ANON__[:106]
0000s0sYAML::XS::::__ANON__[:107]YAML::XS::__ANON__[:107]
0000s0sYAML::XS::::__ANON__[:108]YAML::XS::__ANON__[:108]
0000s0sYAML::XS::::__ANON__[:109]YAML::XS::__ANON__[:109]
0000s0sYAML::XS::::__ANON__[:110]YAML::XS::__ANON__[:110]
0000s0sYAML::XS::::__ANON__[:111]YAML::XS::__ANON__[:111]
0000s0sYAML::XS::::__ANON__[:112]YAML::XS::__ANON__[:112]
0000s0sYAML::XS::::__ANON__[:113]YAML::XS::__ANON__[:113]
0000s0sYAML::XS::::__ANON__[:114]YAML::XS::__ANON__[:114]
0000s0sYAML::XS::::__ANON__[:115]YAML::XS::__ANON__[:115]
0000s0sYAML::XS::::__ANON__[:135]YAML::XS::__ANON__[:135]
0000s0sYAML::XS::::__ANON__[:73]YAML::XS::__ANON__[:73]
0000s0sYAML::XS::::__ANON__[:97]YAML::XS::__ANON__[:97]
0000s0sYAML::XS::::__code_loaderYAML::XS::__code_loader
0000s0sYAML::XS::::__qr_loaderYAML::XS::__qr_loader
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1452µs443µs
# spent 11µs (9+2) within RBM::BEGIN@1.2 which was called: # once (9µs+2µs) by RBM::BEGIN@8 at line 1 # spent 18µs (5+13) within RBM::BEGIN@1.3 which was called: # once (5µs+13µs) by RBM::BEGIN@8 at line 1
use strict; use warnings;
# spent 18µs making 1 call to RBM::BEGIN@1.3 # spent 13µs making 1 call to warnings::import # spent 11µs making 1 call to RBM::BEGIN@1.2 # spent 2µs making 1 call to strict::import
2
3package YAML::XS;
41300nsour $VERSION = '0.76';
5
62137µs21.47ms
# spent 1.41ms (1.32+90µs) within YAML::XS::BEGIN@6 which was called: # once (1.32ms+90µs) by RBM::BEGIN@8 at line 6
use base 'Exporter';
# spent 1.41ms making 1 call to YAML::XS::BEGIN@6 # spent 60µs making 1 call to base::import
7
811µs@YAML::XS::EXPORT = qw(Load Dump);
91600ns@YAML::XS::EXPORT_OK = qw(LoadFile DumpFile);
1012µs%YAML::XS::EXPORT_TAGS = (
11 all => [qw(Dump Load LoadFile DumpFile)],
12);
13our ($UseCode, $DumpCode, $LoadCode, $Boolean, $LoadBlessed, $Indent);
14# $YAML::XS::UseCode = 0;
15# $YAML::XS::DumpCode = 0;
16# $YAML::XS::LoadCode = 0;
17
181200ns$YAML::XS::QuoteNumericStrings = 1;
19
202103µs2667µs
# spent 634µs (268+366) within YAML::XS::BEGIN@20 which was called: # once (268µs+366µs) by RBM::BEGIN@8 at line 20
use YAML::XS::LibYAML qw(Load Dump);
# spent 634µs making 1 call to YAML::XS::BEGIN@20 # spent 33µs making 1 call to Exporter::import
2121.10ms21.22ms
# spent 1.18ms (872µs+306µs) within YAML::XS::BEGIN@21 which was called: # once (872µs+306µs) by RBM::BEGIN@8 at line 21
use Scalar::Util qw/ openhandle /;
# spent 1.18ms making 1 call to YAML::XS::BEGIN@21 # spent 46µs making 1 call to Exporter::import
22
23sub DumpFile {
24 my $OUT;
25 my $filename = shift;
26 if (openhandle $filename) {
27 $OUT = $filename;
28 }
29 else {
30 my $mode = '>';
31 if ($filename =~ /^\s*(>{1,2})\s*(.*)$/) {
32 ($mode, $filename) = ($1, $2);
33 }
34 open $OUT, $mode, $filename
35 or die "Can't open '$filename' for output:\n$!";
36 }
37 local $/ = "\n"; # reset special to "sane"
38 print $OUT YAML::XS::LibYAML::Dump(@_);
39}
40
41
# spent 12.7ms (2.03+10.7) within YAML::XS::LoadFile which was called 144 times, avg 88µs/call: # 144 times (2.03ms+10.7ms) by RBM::load_config_file at line 32 of /root/tor-browser-build/rbm/lib/RBM.pm, avg 88µs/call
sub LoadFile {
4214415µs my $IN;
4314432µs my $filename = shift;
44144296µs14456µs if (openhandle $filename) {
# spent 56µs making 144 calls to Scalar::Util::openhandle, avg 390ns/call
45 $IN = $filename;
46 }
47 else {
481441.27ms144905µs open $IN, $filename
# spent 905µs making 144 calls to YAML::XS::CORE:open, avg 6µs/call
49 or die "Can't open '$filename' for input:\n$!";
50 }
5143211.2ms2889.70ms return YAML::XS::LibYAML::Load(do { local $/; local $_ = <$IN> });
# spent 8.84ms making 144 calls to YAML::XS::LibYAML::Load, avg 61µs/call # spent 859µs making 144 calls to YAML::XS::CORE:readline, avg 6µs/call
52}
53
54
55# XXX The following code should be moved from Perl to C.
56$YAML::XS::coderef2text = sub {
57 my $coderef = shift;
58 require B::Deparse;
59 my $deparse = B::Deparse->new();
60 my $text;
61 eval {
62 local $^W = 0;
63 $text = $deparse->coderef2text($coderef);
64 };
65 if ($@) {
66 warn "YAML::XS failed to dump code ref:\n$@";
67 return;
68 }
69 $text =~ s[BEGIN \{\$\{\^WARNING_BITS\} = "UUUUUUUUUUUU\\001"\}]
70 [use warnings;]g;
71
72 return $text;
7312µs};
74
75$YAML::XS::glob2hash = sub {
76 my $hash = {};
77 for my $type (qw(PACKAGE NAME SCALAR ARRAY HASH CODE IO)) {
78 my $value = *{$_[0]}{$type};
79 $value = $$value if $type eq 'SCALAR';
80 if (defined $value) {
81 if ($type eq 'IO') {
82 my @stats = qw(device inode mode links uid gid rdev size
83 atime mtime ctime blksize blocks);
84 undef $value;
85 $value->{stat} = {};
86 map {$value->{stat}{shift @stats} = $_} stat(*{$_[0]});
87 $value->{fileno} = fileno(*{$_[0]});
88 {
89 local $^W;
90 $value->{tell} = tell(*{$_[0]});
91 }
92 }
93 $hash->{$type} = $value;
94 }
95 }
96 return $hash;
9712µs};
98
99
# spent 79µs (26+53) within YAML::XS::BEGIN@99 which was called: # once (26µs+53µs) by RBM::BEGIN@8 at line 116
use constant _QR_MAP => {
100 '' => sub { qr{$_[0]} },
101 x => sub { qr{$_[0]}x },
102 i => sub { qr{$_[0]}i },
103 s => sub { qr{$_[0]}s },
104 m => sub { qr{$_[0]}m },
105 ix => sub { qr{$_[0]}ix },
106 sx => sub { qr{$_[0]}sx },
107 mx => sub { qr{$_[0]}mx },
108 si => sub { qr{$_[0]}si },
109 mi => sub { qr{$_[0]}mi },
110 ms => sub { qr{$_[0]}sm },
111 six => sub { qr{$_[0]}six },
112 mix => sub { qr{$_[0]}mix },
113 msx => sub { qr{$_[0]}msx },
114 msi => sub { qr{$_[0]}msi },
115 msix => sub { qr{$_[0]}msix },
1162239µs2132µs};
# spent 79µs making 1 call to YAML::XS::BEGIN@99 # spent 53µs making 1 call to constant::import
117
118sub __qr_loader {
119 if ($_[0] =~ /\A \(\? ([\^uixsm]*) (?:- (?:[ixsm]*))? : (.*) \) \z/x) {
120 my ($flags, $re) = ($1, $2);
121 $flags =~ s/^\^//;
122 $flags =~ tr/u//d;
123 my $sub = _QR_MAP->{$flags} || _QR_MAP->{''};
124 my $qr = &$sub($re);
125 return $qr;
126 }
127 return qr/$_[0]/;
128}
129
130sub __code_loader {
131 my ($string) = @_;
132 my $sub = eval "sub $string";
133 if ($@) {
134 warn "YAML::XS failed to load sub: $@";
135 return sub {};
136 }
137 return $sub;
138}
139
14018µs1;
 
# spent 905µs within YAML::XS::CORE:open which was called 144 times, avg 6µs/call: # 144 times (905µs+0s) by YAML::XS::LoadFile at line 48, avg 6µs/call
sub YAML::XS::CORE:open; # opcode
# spent 859µs within YAML::XS::CORE:readline which was called 144 times, avg 6µs/call: # 144 times (859µs+0s) by YAML::XS::LoadFile at line 51, avg 6µs/call
sub YAML::XS::CORE:readline; # opcode