Filename | /usr/share/perl5/YAML.pm |
Statements | Executed 386 statements in 5.24ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
32 | 1 | 1 | 8.79ms | 68.9ms | init_action_object | YAML::
1 | 1 | 1 | 1.50ms | 2.09ms | BEGIN@7 | YAML::
1 | 1 | 1 | 1.39ms | 1.58ms | BEGIN@6 | YAML::
32 | 1 | 1 | 1.02ms | 82.3ms | Load | YAML::
1 | 1 | 1 | 37µs | 37µs | BEGIN@3 | YAML::
1 | 1 | 1 | 17µs | 24µs | BEGIN@4 | YAML::
1 | 1 | 1 | 15µs | 80µs | BEGIN@15 | YAML::
1 | 1 | 1 | 15µs | 40µs | BEGIN@5 | YAML::
1 | 1 | 1 | 14µs | 38µs | BEGIN@40 | YAML::
0 | 0 | 0 | 0s | 0s | Bless | YAML::
0 | 0 | 0 | 0s | 0s | Blessed | YAML::
0 | 0 | 0 | 0s | 0s | Dump | YAML::
0 | 0 | 0 | 0s | 0s | DumpFile | YAML::
0 | 0 | 0 | 0s | 0s | LoadFile | YAML::
0 | 0 | 0 | 0s | 0s | global_object | YAML::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package YAML; | ||||
2 | |||||
3 | 3 | 54µs | 1 | 37µs | # spent 37µs within YAML::BEGIN@3 which was called:
# once (37µs+0s) by C4::Search::BEGIN@34 at line 3 # spent 37µs making 1 call to YAML::BEGIN@3 |
4 | 3 | 30µs | 2 | 32µs | # spent 24µs (17+7) within YAML::BEGIN@4 which was called:
# once (17µs+7µs) by C4::Search::BEGIN@34 at line 4 # spent 24µs making 1 call to YAML::BEGIN@4
# spent 7µs making 1 call to strict::import |
5 | 3 | 29µs | 2 | 64µs | # spent 40µs (15+25) within YAML::BEGIN@5 which was called:
# once (15µs+25µs) by C4::Search::BEGIN@34 at line 5 # spent 40µs making 1 call to YAML::BEGIN@5
# spent 25µs making 1 call to warnings::import |
6 | 3 | 136µs | 2 | 1.63ms | # spent 1.58ms (1.39+189µs) within YAML::BEGIN@6 which was called:
# once (1.39ms+189µs) by C4::Search::BEGIN@34 at line 6 # spent 1.58ms making 1 call to YAML::BEGIN@6
# spent 57µs making 1 call to Exporter::import |
7 | 3 | 187µs | 2 | 2.14ms | # spent 2.09ms (1.50+590µs) within YAML::BEGIN@7 which was called:
# once (1.50ms+590µs) by C4::Search::BEGIN@34 at line 7 # spent 2.09ms making 1 call to YAML::BEGIN@7
# spent 50µs making 1 call to Exporter::import |
8 | |||||
9 | 1 | 900ns | our $VERSION = '0.71'; | ||
10 | 1 | 10µs | our @ISA = 'YAML::Base'; | ||
11 | 1 | 1µs | our @EXPORT = qw{ Dump Load }; | ||
12 | 1 | 1µs | our @EXPORT_OK = qw{ freeze thaw DumpFile LoadFile Bless Blessed }; | ||
13 | |||||
14 | # XXX This VALUE nonsense needs to go. | ||||
15 | 3 | 158µs | 2 | 146µs | # spent 80µs (15+65) within YAML::BEGIN@15 which was called:
# once (15µs+65µs) by C4::Search::BEGIN@34 at line 15 # spent 80µs making 1 call to YAML::BEGIN@15
# spent 65µs making 1 call to constant::import |
16 | |||||
17 | # YAML Object Properties | ||||
18 | 1 | 3µs | 1 | 346µs | field dumper_class => 'YAML::Dumper'; # spent 346µs making 1 call to YAML::Base::field |
19 | 1 | 2µs | 1 | 188µs | field loader_class => 'YAML::Loader'; # spent 188µs making 1 call to YAML::Base::field |
20 | 1 | 3µs | 1 | 202µs | field dumper_object => # spent 202µs making 1 call to YAML::Base::field |
21 | -init => '$self->init_action_object("dumper")'; | ||||
22 | 1 | 3µs | 1 | 200µs | field loader_object => # spent 200µs making 1 call to YAML::Base::field |
23 | -init => '$self->init_action_object("loader")'; | ||||
24 | |||||
25 | sub Dump { | ||||
26 | my $yaml = YAML->new; | ||||
27 | $yaml->dumper_class($YAML::DumperClass) | ||||
28 | if $YAML::DumperClass; | ||||
29 | return $yaml->dumper_object->dump(@_); | ||||
30 | } | ||||
31 | |||||
32 | # spent 82.3ms (1.02+81.2) within YAML::Load which was called 32 times, avg 2.57ms/call:
# 32 times (1.02ms+81.2ms) by C4::Items::GetHiddenItemnumbers at line 1644 of /usr/share/koha/lib/C4/Items.pm, avg 2.57ms/call | ||||
33 | 96 | 909µs | 32 | 526µs | my $yaml = YAML->new; # spent 526µs making 32 calls to YAML::Base::new, avg 16µs/call |
34 | $yaml->loader_class($YAML::LoaderClass) | ||||
35 | if $YAML::LoaderClass; | ||||
36 | 64 | 80.7ms | return $yaml->loader_object->load(@_); # spent 69.6ms making 32 calls to YAML::Base::__ANON__[(eval 1028)[YAML/Base.pm:73]:7], avg 2.17ms/call
# spent 11.1ms making 32 calls to YAML::Loader::load, avg 348µs/call | ||
37 | } | ||||
38 | |||||
39 | { | ||||
40 | 4 | 428µs | 2 | 61µs | # spent 38µs (14+23) within YAML::BEGIN@40 which was called:
# once (14µs+23µs) by C4::Search::BEGIN@34 at line 40 # spent 38µs making 1 call to YAML::BEGIN@40
# spent 23µs making 1 call to warnings::unimport |
41 | # freeze/thaw is the API for Storable string serialization. Some | ||||
42 | # modules make use of serializing packages on if they use freeze/thaw. | ||||
43 | 1 | 2µs | *freeze = \ &Dump; | ||
44 | 1 | 2µs | *thaw = \ &Load; | ||
45 | } | ||||
46 | |||||
47 | sub DumpFile { | ||||
48 | my $OUT; | ||||
49 | my $filename = shift; | ||||
50 | if (ref $filename eq 'GLOB') { | ||||
51 | $OUT = $filename; | ||||
52 | } | ||||
53 | else { | ||||
54 | my $mode = '>'; | ||||
55 | if ($filename =~ /^\s*(>{1,2})\s*(.*)$/) { | ||||
56 | ($mode, $filename) = ($1, $2); | ||||
57 | } | ||||
58 | open $OUT, $mode, $filename | ||||
59 | or YAML::Base->die('YAML_DUMP_ERR_FILE_OUTPUT', $filename, $!); | ||||
60 | } | ||||
61 | binmode $OUT, ':utf8'; # if $Config{useperlio} eq 'define'; | ||||
62 | local $/ = "\n"; # reset special to "sane" | ||||
63 | print $OUT Dump(@_); | ||||
64 | } | ||||
65 | |||||
66 | sub LoadFile { | ||||
67 | my $IN; | ||||
68 | my $filename = shift; | ||||
69 | if (ref $filename eq 'GLOB') { | ||||
70 | $IN = $filename; | ||||
71 | } | ||||
72 | else { | ||||
73 | open $IN, '<', $filename | ||||
74 | or YAML::Base->die('YAML_LOAD_ERR_FILE_INPUT', $filename, $!); | ||||
75 | } | ||||
76 | binmode $IN, ':utf8'; # if $Config{useperlio} eq 'define'; | ||||
77 | return Load(do { local $/; <$IN> }); | ||||
78 | } | ||||
79 | |||||
80 | # spent 68.9ms (8.79+60.1) within YAML::init_action_object which was called 32 times, avg 2.15ms/call:
# 32 times (8.79ms+60.1ms) by YAML::Base::__ANON__[(eval 1028)[/usr/share/perl5/YAML/Base.pm:73]:7] at line 2 of (eval 1028)[YAML/Base.pm:73], avg 2.15ms/call | ||||
81 | 256 | 3.27ms | my $self = shift; | ||
82 | my $object_class = (shift) . '_class'; | ||||
83 | 32 | 351µs | my $module_name = $self->$object_class; # spent 351µs making 32 calls to YAML::Base::__ANON__[(eval 1026)[YAML/Base.pm:73]:8], avg 11µs/call | ||
84 | eval "require $module_name"; # spent 448µs executing statements in 32 string evals (merged) | ||||
85 | $self->die("Error in require $module_name - $@") | ||||
86 | if $@ and "$@" !~ /Can't locate/; | ||||
87 | 64 | 504µs | my $object = $self->$object_class->new; # spent 266µs making 32 calls to YAML::Base::__ANON__[(eval 1026)[YAML/Base.pm:73]:8], avg 8µs/call
# spent 239µs making 32 calls to YAML::Base::new, avg 7µs/call | ||
88 | 32 | 204µs | $object->set_global_options; # spent 204µs making 32 calls to YAML::Loader::Base::set_global_options, avg 6µs/call | ||
89 | return $object; | ||||
90 | } | ||||
91 | |||||
92 | 1 | 800ns | my $global = {}; | ||
93 | sub Bless { | ||||
94 | require YAML::Dumper::Base; | ||||
95 | YAML::Dumper::Base::bless($global, @_) | ||||
96 | } | ||||
97 | sub Blessed { | ||||
98 | require YAML::Dumper::Base; | ||||
99 | YAML::Dumper::Base::blessed($global, @_) | ||||
100 | } | ||||
101 | sub global_object { $global } | ||||
102 | |||||
103 | 1 | 12µs | 1; | ||
104 | |||||
105 | __END__ |