← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:07 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/YAML/XS.pm
StatementsExecuted 22 statements in 753µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11120.3ms30.7msYAML::XS::::BEGIN@57 YAML::XS::BEGIN@57
111125µs352µsYAML::XS::::BEGIN@19 YAML::XS::BEGIN@19
11119µs64µsYAML::XS::::BEGIN@102 YAML::XS::BEGIN@102
11111µs12µsYAML::Any::::BEGIN@1YAML::Any::BEGIN@1
1118µs60µsYAML::XS::::BEGIN@6 YAML::XS::BEGIN@6
1118µs23µsYAML::XS::::BEGIN@20 YAML::XS::BEGIN@20
1116µs9µsYAML::Any::::BEGIN@1.28YAML::Any::BEGIN@1.28
0000s0sYAML::XS::::DumpFile YAML::XS::DumpFile
0000s0sYAML::XS::::LoadFile YAML::XS::LoadFile
0000s0sYAML::XS::::__ANON__[:100] YAML::XS::__ANON__[:100]
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__[:116] YAML::XS::__ANON__[:116]
0000s0sYAML::XS::::__ANON__[:117] YAML::XS::__ANON__[:117]
0000s0sYAML::XS::::__ANON__[:118] YAML::XS::__ANON__[:118]
0000s0sYAML::XS::::__ANON__[:76] YAML::XS::__ANON__[:76]
0000s0sYAML::XS::::__qr_loader YAML::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
1439µs425µs
# spent 12µs (11+1) within YAML::Any::BEGIN@1 which was called: # once (11µs+1µs) by YAML::Any::implementation at line 1 # spent 9µs (6+3) within YAML::Any::BEGIN@1.28 which was called: # once (6µs+3µs) by YAML::Any::implementation at line 1
use strict; use warnings;
# spent 12µs making 1 call to YAML::Any::BEGIN@1 # spent 9µs making 1 call to YAML::Any::BEGIN@1.28 # spent 3µs making 1 call to warnings::import # spent 1µs making 1 call to strict::import
2
3package YAML::XS;
41300nsour $VERSION = '0.62';
5
6246µs2113µs
# spent 60µs (8+52) within YAML::XS::BEGIN@6 which was called: # once (8µs+52µs) by YAML::Any::implementation at line 6
use base 'Exporter';
# spent 60µs making 1 call to YAML::XS::BEGIN@6 # spent 52µs making 1 call to base::import
7
81600ns@YAML::XS::EXPORT = qw(Load Dump);
91400ns@YAML::XS::EXPORT_OK = qw(LoadFile DumpFile);
1012µs%YAML::XS::EXPORT_TAGS = (
11 all => [qw(Dump Load LoadFile DumpFile)],
12);
13# $YAML::XS::UseCode = 0;
14# $YAML::XS::DumpCode = 0;
15# $YAML::XS::LoadCode = 0;
16
171200ns$YAML::XS::QuoteNumericStrings = 1;
18
19263µs2388µs
# spent 352µs (125+228) within YAML::XS::BEGIN@19 which was called: # once (125µs+228µs) by YAML::Any::implementation at line 19
use YAML::XS::LibYAML qw(Load Dump);
# spent 352µs making 1 call to YAML::XS::BEGIN@19 # spent 36µs making 1 call to Exporter::import
202155µs238µs
# spent 23µs (8+15) within YAML::XS::BEGIN@20 which was called: # once (8µs+15µs) by YAML::Any::implementation at line 20
use Scalar::Util qw/ openhandle /;
# spent 23µs making 1 call to YAML::XS::BEGIN@20 # spent 15µs making 1 call to Exporter::import
21
22sub DumpFile {
23 my $OUT;
24 my $filename = shift;
25 if (openhandle $filename) {
26 $OUT = $filename;
27 }
28 else {
29 my $mode = '>';
30 if ($filename =~ /^\s*(>{1,2})\s*(.*)$/) {
31 ($mode, $filename) = ($1, $2);
32 }
33 open $OUT, $mode, $filename
34 or die "Can't open '$filename' for output:\n$!";
35 }
36 local $/ = "\n"; # reset special to "sane"
37 print $OUT YAML::XS::LibYAML::Dump(@_);
38}
39
40sub LoadFile {
41 my $IN;
42 my $filename = shift;
43 if (openhandle $filename) {
44 $IN = $filename;
45 }
46 else {
47 open $IN, $filename
48 or die "Can't open '$filename' for input:\n$!";
49 }
50 return YAML::XS::LibYAML::Load(do { local $/; local $_ = <$IN> });
51}
52
53# XXX Figure out how to lazily load this module.
54# So far I've tried using the C function:
55# load_module(PERL_LOADMOD_NOIMPORT, newSVpv("B::Deparse", 0), NULL);
56# But it didn't seem to work.
572357µs130.7ms
# spent 30.7ms (20.3+10.3) within YAML::XS::BEGIN@57 which was called: # once (20.3ms+10.3ms) by YAML::Any::implementation at line 57
use B::Deparse;
# spent 30.7ms making 1 call to YAML::XS::BEGIN@57
58
59# XXX The following code should be moved from Perl to C.
60$YAML::XS::coderef2text = sub {
61 my $coderef = shift;
62 my $deparse = B::Deparse->new();
63 my $text;
64 eval {
65 local $^W = 0;
66 $text = $deparse->coderef2text($coderef);
67 };
68 if ($@) {
69 warn "YAML::XS failed to dump code ref:\n$@";
70 return;
71 }
72 $text =~ s[BEGIN \{\$\{\^WARNING_BITS\} = "UUUUUUUUUUUU\\001"\}]
73 [use warnings;]g;
74
75 return $text;
7611µs};
77
78$YAML::XS::glob2hash = sub {
79 my $hash = {};
80 for my $type (qw(PACKAGE NAME SCALAR ARRAY HASH CODE IO)) {
81 my $value = *{$_[0]}{$type};
82 $value = $$value if $type eq 'SCALAR';
83 if (defined $value) {
84 if ($type eq 'IO') {
85 my @stats = qw(device inode mode links uid gid rdev size
86 atime mtime ctime blksize blocks);
87 undef $value;
88 $value->{stat} = {};
89 map {$value->{stat}{shift @stats} = $_} stat(*{$_[0]});
90 $value->{fileno} = fileno(*{$_[0]});
91 {
92 local $^W;
93 $value->{tell} = tell(*{$_[0]});
94 }
95 }
96 $hash->{$type} = $value;
97 }
98 }
99 return $hash;
1001600ns};
101
102
# spent 64µs (19+45) within YAML::XS::BEGIN@102 which was called: # once (19µs+45µs) by YAML::Any::implementation at line 119
use constant _QR_MAP => {
103 '' => sub { qr{$_[0]} },
104 x => sub { qr{$_[0]}x },
105 i => sub { qr{$_[0]}i },
106 s => sub { qr{$_[0]}s },
107 m => sub { qr{$_[0]}m },
108 ix => sub { qr{$_[0]}ix },
109 sx => sub { qr{$_[0]}sx },
110 mx => sub { qr{$_[0]}mx },
111 si => sub { qr{$_[0]}si },
112 mi => sub { qr{$_[0]}mi },
113 ms => sub { qr{$_[0]}sm },
114 six => sub { qr{$_[0]}six },
115 mix => sub { qr{$_[0]}mix },
116 msx => sub { qr{$_[0]}msx },
117 msi => sub { qr{$_[0]}msi },
118 msix => sub { qr{$_[0]}msix },
119285µs2109µs};
# spent 64µs making 1 call to YAML::XS::BEGIN@102 # spent 45µs making 1 call to constant::import
120
121sub __qr_loader {
122 if ($_[0] =~ /\A \(\? ([ixsm]*) (?:- (?:[ixsm]*))? : (.*) \) \z/x) {
123 my $sub = _QR_MAP->{$1} || _QR_MAP->{''};
124 &$sub($2);
125 }
126 else {
127 qr/$_[0]/;
128 }
129}
130
13114µs1;