Filename | /usr/share/perl5/YAML.pm |
Statements | Executed 386 statements in 5.08ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
32 | 1 | 1 | 11.2ms | 75.3ms | init_action_object | YAML::
1 | 1 | 1 | 1.58ms | 2.14ms | BEGIN@7 | YAML::
1 | 1 | 1 | 1.28ms | 1.47ms | BEGIN@6 | YAML::
32 | 1 | 1 | 915µs | 87.5ms | Load | YAML::
1 | 1 | 1 | 44µs | 44µs | BEGIN@3 | YAML::
1 | 1 | 1 | 22µs | 31µs | BEGIN@4 | YAML::
1 | 1 | 1 | 20µs | 48µs | BEGIN@5 | YAML::
1 | 1 | 1 | 15µs | 73µs | BEGIN@15 | YAML::
1 | 1 | 1 | 12µs | 30µ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 | 70µs | 1 | 44µs | # spent 44µs within YAML::BEGIN@3 which was called:
# once (44µs+0s) by C4::Search::BEGIN@34 at line 3 # spent 44µs making 1 call to YAML::BEGIN@3 |
4 | 3 | 47µs | 2 | 40µs | # spent 31µs (22+9) within YAML::BEGIN@4 which was called:
# once (22µs+9µs) by C4::Search::BEGIN@34 at line 4 # spent 31µs making 1 call to YAML::BEGIN@4
# spent 9µs making 1 call to strict::import |
5 | 3 | 41µs | 2 | 75µs | # spent 48µs (20+28) within YAML::BEGIN@5 which was called:
# once (20µs+28µs) by C4::Search::BEGIN@34 at line 5 # spent 48µs making 1 call to YAML::BEGIN@5
# spent 28µs making 1 call to warnings::import |
6 | 3 | 125µs | 2 | 1.51ms | # spent 1.47ms (1.28+189µs) within YAML::BEGIN@6 which was called:
# once (1.28ms+189µs) by C4::Search::BEGIN@34 at line 6 # spent 1.47ms making 1 call to YAML::BEGIN@6
# spent 44µs making 1 call to Exporter::import |
7 | 3 | 167µs | 2 | 2.18ms | # spent 2.14ms (1.58+555µs) within YAML::BEGIN@7 which was called:
# once (1.58ms+555µs) by C4::Search::BEGIN@34 at line 7 # spent 2.14ms making 1 call to YAML::BEGIN@7
# spent 46µs making 1 call to Exporter::import |
8 | |||||
9 | 1 | 800ns | our $VERSION = '0.71'; | ||
10 | 1 | 9µs | our @ISA = 'YAML::Base'; | ||
11 | 1 | 800ns | 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 | 152µs | 2 | 131µs | # spent 73µs (15+58) within YAML::BEGIN@15 which was called:
# once (15µs+58µs) by C4::Search::BEGIN@34 at line 15 # spent 73µs making 1 call to YAML::BEGIN@15
# spent 58µs making 1 call to constant::import |
16 | |||||
17 | # YAML Object Properties | ||||
18 | 1 | 3µs | 1 | 317µs | field dumper_class => 'YAML::Dumper'; # spent 317µs making 1 call to YAML::Base::field |
19 | 1 | 2µs | 1 | 218µs | field loader_class => 'YAML::Loader'; # spent 218µs making 1 call to YAML::Base::field |
20 | 1 | 3µs | 1 | 227µs | field dumper_object => # spent 227µs making 1 call to YAML::Base::field |
21 | -init => '$self->init_action_object("dumper")'; | ||||
22 | 1 | 3µs | 1 | 210µs | field loader_object => # spent 210µ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 87.5ms (915µs+86.6) within YAML::Load which was called 32 times, avg 2.73ms/call:
# 32 times (915µs+86.6ms) by C4::Items::GetHiddenItemnumbers at line 1644 of /usr/share/koha/lib/C4/Items.pm, avg 2.73ms/call | ||||
33 | 96 | 782µs | 32 | 451µs | my $yaml = YAML->new; # spent 451µs making 32 calls to YAML::Base::new, avg 14µs/call |
34 | $yaml->loader_class($YAML::LoaderClass) | ||||
35 | if $YAML::LoaderClass; | ||||
36 | 64 | 86.2ms | return $yaml->loader_object->load(@_); # spent 75.9ms making 32 calls to YAML::Base::__ANON__[(eval 1045)[YAML/Base.pm:73]:7], avg 2.37ms/call
# spent 10.3ms making 32 calls to YAML::Loader::load, avg 321µs/call | ||
37 | } | ||||
38 | |||||
39 | { | ||||
40 | 4 | 425µs | 2 | 47µs | # spent 30µs (12+17) within YAML::BEGIN@40 which was called:
# once (12µs+17µs) by C4::Search::BEGIN@34 at line 40 # spent 30µs making 1 call to YAML::BEGIN@40
# spent 17µ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 | 2 | 2µs | *freeze = \ &Dump; | ||
44 | *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 75.3ms (11.2+64.1) within YAML::init_action_object which was called 32 times, avg 2.35ms/call:
# 32 times (11.2ms+64.1ms) by YAML::Base::__ANON__[(eval 1045)[/usr/share/perl5/YAML/Base.pm:73]:7] at line 2 of (eval 1045)[YAML/Base.pm:73], avg 2.35ms/call | ||||
81 | 256 | 3.23ms | my $self = shift; | ||
82 | my $object_class = (shift) . '_class'; | ||||
83 | 32 | 287µs | my $module_name = $self->$object_class; # spent 287µs making 32 calls to YAML::Base::__ANON__[(eval 1043)[YAML/Base.pm:73]:8], avg 9µs/call | ||
84 | eval "require $module_name"; # spent 372µs executing statements in 32 string evals (merged) | ||||
85 | $self->die("Error in require $module_name - $@") | ||||
86 | if $@ and "$@" !~ /Can't locate/; | ||||
87 | 64 | 588µs | my $object = $self->$object_class->new; # spent 320µs making 32 calls to YAML::Base::__ANON__[(eval 1043)[YAML/Base.pm:73]:8], avg 10µs/call
# spent 268µs making 32 calls to YAML::Base::new, avg 8µs/call | ||
88 | 32 | 161µs | $object->set_global_options; # spent 161µs making 32 calls to YAML::Loader::Base::set_global_options, avg 5µ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 | 11µs | 1; | ||
104 | |||||
105 | __END__ |