← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:50 2015

Filename/usr/lib/x86_64-linux-gnu/perl5/5.20/YAML/Syck.pm
StatementsExecuted 26 statements in 1.42ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111151µs151µsYAML::Syck::::LoadYAMLYAML::Syck::LoadYAML (xsub)
11162µs62µsYAML::Syck::::DumpYAMLYAML::Syck::DumpYAML (xsub)
11127µs68µsYAML::Syck::::BEGIN@38YAML::Syck::BEGIN@38
11120µs210µsYAML::Syck::::BEGIN@16YAML::Syck::BEGIN@16
11114µs166µsYAML::Syck::::LoadYAML::Syck::Load
11114µs14µsYAML::Syck::::BEGIN@13YAML::Syck::BEGIN@13
11112µs23µsYAML::Syck::::BEGIN@5YAML::Syck::BEGIN@5
1119µs22µsYAML::Syck::::BEGIN@14YAML::Syck::BEGIN@14
1118µs132µsYAML::Syck::::BEGIN@6YAML::Syck::BEGIN@6
1117µs69µsYAML::Syck::::DumpYAML::Syck::Dump
0000s0sYAML::Syck::::DumpFileYAML::Syck::DumpFile
0000s0sYAML::Syck::::DumpIntoYAML::Syck::DumpInto
0000s0sYAML::Syck::::LoadFileYAML::Syck::LoadFile
0000s0sYAML::Syck::::__ANON__[:39]YAML::Syck::__ANON__[:39]
0000s0sYAML::Syck::::__ANON__[:40]YAML::Syck::__ANON__[:40]
0000s0sYAML::Syck::::__ANON__[:41]YAML::Syck::__ANON__[:41]
0000s0sYAML::Syck::::__ANON__[:42]YAML::Syck::__ANON__[:42]
0000s0sYAML::Syck::::__ANON__[:43]YAML::Syck::__ANON__[:43]
0000s0sYAML::Syck::::__ANON__[:44]YAML::Syck::__ANON__[:44]
0000s0sYAML::Syck::::__ANON__[:45]YAML::Syck::__ANON__[:45]
0000s0sYAML::Syck::::__ANON__[:46]YAML::Syck::__ANON__[:46]
0000s0sYAML::Syck::::__ANON__[:47]YAML::Syck::__ANON__[:47]
0000s0sYAML::Syck::::__ANON__[:48]YAML::Syck::__ANON__[:48]
0000s0sYAML::Syck::::__ANON__[:49]YAML::Syck::__ANON__[:49]
0000s0sYAML::Syck::::__ANON__[:50]YAML::Syck::__ANON__[:50]
0000s0sYAML::Syck::::__ANON__[:51]YAML::Syck::__ANON__[:51]
0000s0sYAML::Syck::::__ANON__[:52]YAML::Syck::__ANON__[:52]
0000s0sYAML::Syck::::__ANON__[:53]YAML::Syck::__ANON__[:53]
0000s0sYAML::Syck::::__ANON__[:54]YAML::Syck::__ANON__[:54]
0000s0sYAML::Syck::::__qr_helperYAML::Syck::__qr_helper
0000s0sYAML::Syck::::_is_globYAML::Syck::_is_glob
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package YAML::Syck;
2
3# See documentation after the __END__ mark.
4
5238µs234µs
# spent 23µs (12+11) within YAML::Syck::BEGIN@5 which was called: # once (12µs+11µs) by C4::Message::BEGIN@26 at line 5
use strict;
# spent 23µs making 1 call to YAML::Syck::BEGIN@5 # spent 11µs making 1 call to strict::import
615µs1124µs
# spent 132µs (8+124) within YAML::Syck::BEGIN@6 which was called: # once (8µs+124µs) by C4::Message::BEGIN@26 at line 12
use vars qw(
# spent 124µs making 1 call to vars::import
7 @ISA @EXPORT @EXPORT_OK $VERSION
8 $Headless $SortKeys $SingleQuote
9 $ImplicitBinary $ImplicitTyping $ImplicitUnicode
10 $UseCode $LoadCode $DumpCode
11 $DeparseObject $LoadBlessed
12119µs1132µs);
# spent 132µs making 1 call to YAML::Syck::BEGIN@6
13240µs114µs
# spent 14µs within YAML::Syck::BEGIN@13 which was called: # once (14µs+0s) by C4::Message::BEGIN@26 at line 13
use 5.006;
# spent 14µs making 1 call to YAML::Syck::BEGIN@13
14295µs236µs
# spent 22µs (9+14) within YAML::Syck::BEGIN@14 which was called: # once (9µs+14µs) by C4::Message::BEGIN@26 at line 14
use Exporter;
# spent 22µs making 1 call to YAML::Syck::BEGIN@14 # spent 14µs making 1 call to Exporter::import
15
16
# spent 210µs (20+190) within YAML::Syck::BEGIN@16 which was called: # once (20µs+190µs) by C4::Message::BEGIN@26 at line 36
BEGIN {
171300ns $VERSION = '1.27';
181700ns @EXPORT = qw( Dump Load DumpFile LoadFile );
191200ns @EXPORT_OK = qw( DumpInto );
2015µs @ISA = qw( Exporter );
21
221200ns $SortKeys = 1;
231100ns $LoadBlessed = 1;
24
251300ns local $@;
26 eval {
2711µs require XSLoader;
281197µs1190µs XSLoader::load( __PACKAGE__, $VERSION );
# spent 190µs making 1 call to XSLoader::load
291600ns 1;
3013µs } or do {
31 require DynaLoader;
32 push @ISA, 'DynaLoader';
33 __PACKAGE__->bootstrap($VERSION);
34 };
35
361282µs1210µs}
# spent 210µs making 1 call to YAML::Syck::BEGIN@16
37
38
# spent 68µs (27+41) within YAML::Syck::BEGIN@38 which was called: # once (27µs+41µs) by C4::Message::BEGIN@26 at line 55
use constant QR_MAP => {
39 '' => sub { qr{$_[0]} },
40 x => sub { qr{$_[0]}x },
41 i => sub { qr{$_[0]}i },
42 s => sub { qr{$_[0]}s },
43 m => sub { qr{$_[0]}m },
44 ix => sub { qr{$_[0]}ix },
45 sx => sub { qr{$_[0]}sx },
46 mx => sub { qr{$_[0]}mx },
47 si => sub { qr{$_[0]}si },
48 mi => sub { qr{$_[0]}mi },
49 ms => sub { qr{$_[0]}sm },
50 six => sub { qr{$_[0]}six },
51 mix => sub { qr{$_[0]}mix },
52 msx => sub { qr{$_[0]}msx },
53 msi => sub { qr{$_[0]}msi },
54 msix => sub { qr{$_[0]}msix },
552492µs2110µs};
# spent 68µs making 1 call to YAML::Syck::BEGIN@38 # spent 41µs making 1 call to constant::import
56
57sub __qr_helper {
58 if ( $_[0] =~ /\A \(\? ([ixsm]*) (?:- (?:[ixsm]*))? : (.*) \) \z/x ) {
59 my $sub = QR_MAP()->{$1} || QR_MAP()->{''};
60 &$sub($2);
61 }
62 else {
63 qr/$_[0]/;
64 }
65}
66
67
# spent 69µs (7+62) within YAML::Syck::Dump which was called: # once (7µs+62µs) by CGI::Session::Serialize::yaml::freeze at line 18 of CGI/Session/Serialize/yaml.pm
sub Dump {
68 $#_
69170µs162µs ? join( '', map { YAML::Syck::DumpYAML($_) } @_ )
# spent 62µs making 1 call to YAML::Syck::DumpYAML
70 : YAML::Syck::DumpYAML( $_[0] );
71}
72
73
# spent 166µs (14+151) within YAML::Syck::Load which was called: # once (14µs+151µs) by CGI::Session::Serialize::yaml::thaw at line 24 of CGI/Session/Serialize/yaml.pm
sub Load {
7416µs if (wantarray) {
751161µs1151µs my ($rv) = YAML::Syck::LoadYAML( $_[0] );
# spent 151µs making 1 call to YAML::Syck::LoadYAML
7611µs @{$rv};
77 }
78 else {
79 @_ = $_[0];
80 goto &YAML::Syck::LoadYAML;
81 }
82}
83
84sub _is_glob {
85 my $h = shift;
86
87 return 1 if ( ref($h) eq 'GLOB' );
88 return 1 if ( ref( \$h ) eq 'GLOB' );
89 return 1 if ( ref($h) =~ m/^IO::/ );
90
91 return;
92}
93
94sub DumpFile {
95 my $file = shift;
96 if ( _is_glob($file) ) {
97 for (@_) {
98 my $err = YAML::Syck::DumpYAMLFile( $_, $file );
99 if ($err) {
100 $! = 0 + $err;
101 die "Error writing to filehandle $file: $!\n";
102 }
103 }
104 }
105 else {
106 open( my $fh, '>', $file ) or die "Cannot write to $file: $!";
107 for (@_) {
108 my $err = YAML::Syck::DumpYAMLFile( $_, $fh );
109 if ($err) {
110 $! = 0 + $err;
111 die "Error writing to file $file: $!\n";
112 }
113 }
114 close $fh
115 or die "Error writing to file $file: $!\n";
116 }
117 return 1;
118}
119
120sub LoadFile {
121 my $file = shift;
122 if ( _is_glob($file) ) {
123 Load(
124 do { local $/; <$file> }
125 );
126 }
127 else {
128 if ( !-e $file || -z $file ) {
129 die("'$file' is empty or non-existent");
130 }
131 open( my $fh, '<', $file ) or die "Cannot read from $file: $!";
132 Load(
133 do { local $/; <$fh> }
134 );
135 }
136}
137
138sub DumpInto {
139 my $bufref = shift;
140 ( ref $bufref ) or die "DumpInto not given reference to output buffer\n";
141 YAML::Syck::DumpYAMLInto( $_, $bufref ) for @_;
142 1;
143}
144
14512µs1;
146
147__END__
 
# spent 62µs within YAML::Syck::DumpYAML which was called: # once (62µs+0s) by YAML::Syck::Dump at line 69
sub YAML::Syck::DumpYAML; # xsub
# spent 151µs within YAML::Syck::LoadYAML which was called: # once (151µs+0s) by YAML::Syck::Load at line 75
sub YAML::Syck::LoadYAML; # xsub