← 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/share/perl5/YAML.pm
StatementsExecuted 23 statements in 2.05ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.31ms12.5msYAML::::BEGIN@4YAML::BEGIN@4
1111.80ms2.75msYAML::::BEGIN@11YAML::BEGIN@11
11110µs26µsYAML::::BEGIN@6YAML::BEGIN@6
1119µs50µsYAML::::BEGIN@14YAML::BEGIN@14
1119µs24µsYAML::::BEGIN@37YAML::BEGIN@37
0000s0sYAML::::BlessYAML::Bless
0000s0sYAML::::BlessedYAML::Blessed
0000s0sYAML::::DumpYAML::Dump
0000s0sYAML::::DumpFileYAML::DumpFile
0000s0sYAML::::LoadYAML::Load
0000s0sYAML::::LoadFileYAML::LoadFile
0000s0sYAML::::__ANON__[:17]YAML::__ANON__[:17]
0000s0sYAML::::__ANON__[:18]YAML::__ANON__[:18]
0000s0sYAML::::__ANON__[:19]YAML::__ANON__[:19]
0000s0sYAML::::__ANON__[:20]YAML::__ANON__[:20]
0000s0sYAML::::global_objectYAML::global_object
0000s0sYAML::::init_action_objectYAML::init_action_object
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package YAML;
21400nsour $VERSION = '1.13';
3
42670µs212.5ms
# spent 12.5ms (2.31+10.2) within YAML::BEGIN@4 which was called: # once (2.31ms+10.2ms) by C4::Items::BEGIN@33 at line 4
use YAML::Mo;
# spent 12.5ms making 1 call to YAML::BEGIN@4 # spent 14µs making 1 call to YAML::Mo::__ANON__[YAML/Mo.pm:5]
5
6254µs242µs
# spent 26µs (10+16) within YAML::BEGIN@6 which was called: # once (10µs+16µs) by C4::Items::BEGIN@33 at line 6
use Exporter;
# spent 26µs making 1 call to YAML::BEGIN@6 # spent 16µs making 1 call to Exporter::import
7115µspush @YAML::ISA, 'Exporter';
81700nsour @EXPORT = qw{ Dump Load };
91600nsour @EXPORT_OK = qw{ freeze thaw DumpFile LoadFile Bless Blessed };
10
112769µs22.78ms
# spent 2.75ms (1.80+952µs) within YAML::BEGIN@11 which was called: # once (1.80ms+952µs) by C4::Items::BEGIN@33 at line 11
use YAML::Node; # XXX This is a temp fix for Module::Build
# spent 2.75ms making 1 call to YAML::BEGIN@11 # spent 23µs making 1 call to Exporter::import
12
13# XXX This VALUE nonsense needs to go.
142170µs292µs
# spent 50µs (9+42) within YAML::BEGIN@14 which was called: # once (9µs+42µs) by C4::Items::BEGIN@33 at line 14
use constant VALUE => "\x07YAML\x07VALUE\x07";
# spent 50µs making 1 call to YAML::BEGIN@14 # spent 42µs making 1 call to constant::import
15
16# YAML Object Properties
1713µs127µshas dumper_class => default => sub {'YAML::Dumper'};
# spent 27µs making 1 call to YAML::Mo::__ANON__[YAML/Mo.pm:5]
1812µs116µshas loader_class => default => sub {'YAML::Loader'};
# spent 16µs making 1 call to YAML::Mo::__ANON__[YAML/Mo.pm:5]
1912µs113µshas dumper_object => default => sub {$_[0]->init_action_object("dumper")};
# spent 13µs making 1 call to YAML::Mo::__ANON__[YAML/Mo.pm:5]
2012µs117µshas loader_object => default => sub {$_[0]->init_action_object("loader")};
# spent 17µs making 1 call to YAML::Mo::__ANON__[YAML/Mo.pm:5]
21
22sub Dump {
23 my $yaml = YAML->new;
24 $yaml->dumper_class($YAML::DumperClass)
25 if $YAML::DumperClass;
26 return $yaml->dumper_object->dump(@_);
27}
28
29sub Load {
30 my $yaml = YAML->new;
31 $yaml->loader_class($YAML::LoaderClass)
32 if $YAML::LoaderClass;
33 return $yaml->loader_object->load(@_);
34}
35
36{
373352µs239µs
# spent 24µs (9+15) within YAML::BEGIN@37 which was called: # once (9µs+15µs) by C4::Items::BEGIN@33 at line 37
no warnings 'once';
# spent 24µs making 1 call to YAML::BEGIN@37 # spent 15µs making 1 call to warnings::unimport
38 # freeze/thaw is the API for Storable string serialization. Some
39 # modules make use of serializing packages on if they use freeze/thaw.
401600ns *freeze = \ &Dump;
411400ns *thaw = \ &Load;
42}
43
44sub DumpFile {
45 my $OUT;
46 my $filename = shift;
47 if (ref $filename eq 'GLOB') {
48 $OUT = $filename;
49 }
50 else {
51 my $mode = '>';
52 if ($filename =~ /^\s*(>{1,2})\s*(.*)$/) {
53 ($mode, $filename) = ($1, $2);
54 }
55 open $OUT, $mode, $filename
56 or YAML::Mo::Object->die('YAML_DUMP_ERR_FILE_OUTPUT', $filename, $!);
57 }
58 binmode $OUT, ':utf8'; # if $Config{useperlio} eq 'define';
59 local $/ = "\n"; # reset special to "sane"
60 print $OUT Dump(@_);
61}
62
63sub LoadFile {
64 my $IN;
65 my $filename = shift;
66 if (ref $filename eq 'GLOB') {
67 $IN = $filename;
68 }
69 else {
70 open $IN, '<', $filename
71 or YAML::Mo::Object->die('YAML_LOAD_ERR_FILE_INPUT', $filename, $!);
72 }
73 binmode $IN, ':utf8'; # if $Config{useperlio} eq 'define';
74 return Load(do { local $/; <$IN> });
75}
76
77sub init_action_object {
78 my $self = shift;
79 my $object_class = (shift) . '_class';
80 my $module_name = $self->$object_class;
81 eval "require $module_name";
82 $self->die("Error in require $module_name - $@")
83 if $@ and "$@" !~ /Can't locate/;
84 my $object = $self->$object_class->new;
85 $object->set_global_options;
86 return $object;
87}
88
891300nsmy $global = {};
90sub Bless {
91 require YAML::Dumper::Base;
92 YAML::Dumper::Base::bless($global, @_)
93}
94sub Blessed {
95 require YAML::Dumper::Base;
96 YAML::Dumper::Base::blessed($global, @_)
97}
98sub global_object { $global }
99
10016µs1;