Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/YAML/Any.pm |
Statements | Executed 50 statements in 776µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 668µs | 31.8ms | implementation | YAML::Any::
1 | 1 | 1 | 23µs | 32.1ms | Load | YAML::Any::
1 | 1 | 1 | 20µs | 22µs | BEGIN@1 | BenchmarkAnything::Config::
1 | 1 | 1 | 6µs | 18µs | BEGIN@48 | YAML::Any::
1 | 1 | 1 | 6µs | 12µs | BEGIN@1.27 | BenchmarkAnything::Config::
1 | 1 | 1 | 5µs | 11µs | BEGIN@87 | YAML::Any::
1 | 1 | 1 | 5µs | 11µs | BEGIN@61 | YAML::Any::
1 | 1 | 1 | 5µs | 17µs | BEGIN@49 | YAML::Any::
1 | 1 | 1 | 4µs | 10µs | BEGIN@74 | YAML::Any::
1 | 1 | 1 | 4µs | 9µs | BEGIN@88 | YAML::Any::
1 | 1 | 1 | 4µs | 9µs | BEGIN@75 | YAML::Any::
1 | 1 | 1 | 4µs | 9µs | BEGIN@62 | YAML::Any::
1 | 1 | 1 | 2µs | 2µs | BEGIN@5 | YAML::Any::
1 | 1 | 1 | 2µs | 2µs | CORE:subst (opcode) | YAML::Any::
1 | 1 | 1 | 1µs | 1µs | order | YAML::Any::
0 | 0 | 0 | 0s | 0s | Dump | YAML::Any::
0 | 0 | 0 | 0s | 0s | DumpFile | YAML::Any::
0 | 0 | 0 | 0s | 0s | LoadFile | YAML::Any::
0 | 0 | 0 | 0s | 0s | croak | YAML::Any::
0 | 0 | 0 | 0s | 0s | import | YAML::Any::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 4 | 42µs | 4 | 44µs | # spent 12µs (6+7) within BenchmarkAnything::Config::BEGIN@1.27 which was called:
# once (6µs+7µs) by BenchmarkAnything::Config::_read_config at line 1
# spent 22µs (20+2) within BenchmarkAnything::Config::BEGIN@1 which was called:
# once (20µs+2µs) by BenchmarkAnything::Config::_read_config at line 1 # spent 22µs making 1 call to BenchmarkAnything::Config::BEGIN@1
# spent 12µs making 1 call to BenchmarkAnything::Config::BEGIN@1.27
# spent 7µs making 1 call to warnings::import
# spent 2µs making 1 call to strict::import |
2 | package YAML::Any; | ||||
3 | 1 | 300ns | our $VERSION = '1.15'; | ||
4 | |||||
5 | 2 | 68µs | 1 | 2µs | # spent 2µs within YAML::Any::BEGIN@5 which was called:
# once (2µs+0s) by BenchmarkAnything::Config::_read_config at line 5 # spent 2µs making 1 call to YAML::Any::BEGIN@5 |
6 | |||||
7 | 1 | 6µs | @YAML::Any::ISA = 'Exporter'; | ||
8 | 1 | 400ns | @YAML::Any::EXPORT = qw(Dump Load); | ||
9 | 1 | 300ns | @YAML::Any::EXPORT_OK = qw(DumpFile LoadFile); | ||
10 | |||||
11 | 1 | 900ns | my @dump_options = qw( | ||
12 | UseCode | ||||
13 | DumpCode | ||||
14 | SpecVersion | ||||
15 | Indent | ||||
16 | UseHeader | ||||
17 | UseVersion | ||||
18 | SortKeys | ||||
19 | AnchorPrefix | ||||
20 | UseBlock | ||||
21 | UseFold | ||||
22 | CompressSeries | ||||
23 | InlineSeries | ||||
24 | UseAliases | ||||
25 | Purity | ||||
26 | Stringify | ||||
27 | ); | ||||
28 | |||||
29 | 1 | 200ns | my @load_options = qw( | ||
30 | UseCode | ||||
31 | LoadCode | ||||
32 | ); | ||||
33 | |||||
34 | 1 | 400ns | my @implementations = qw( | ||
35 | YAML::XS | ||||
36 | YAML::Syck | ||||
37 | YAML::Old | ||||
38 | YAML | ||||
39 | YAML::Tiny | ||||
40 | ); | ||||
41 | |||||
42 | sub import { | ||||
43 | __PACKAGE__->implementation; | ||||
44 | goto &Exporter::import; | ||||
45 | } | ||||
46 | |||||
47 | sub Dump { | ||||
48 | 2 | 14µs | 2 | 29µs | # spent 18µs (6+11) within YAML::Any::BEGIN@48 which was called:
# once (6µs+11µs) by BenchmarkAnything::Config::_read_config at line 48 # spent 18µs making 1 call to YAML::Any::BEGIN@48
# spent 11µs making 1 call to strict::unimport |
49 | 2 | 74µs | 2 | 29µs | # spent 17µs (5+12) within YAML::Any::BEGIN@49 which was called:
# once (5µs+12µs) by BenchmarkAnything::Config::_read_config at line 49 # spent 17µs making 1 call to YAML::Any::BEGIN@49
# spent 12µs making 1 call to warnings::unimport |
50 | my $implementation = __PACKAGE__->implementation; | ||||
51 | for my $option (@dump_options) { | ||||
52 | my $var = "$implementation\::$option"; | ||||
53 | my $value = $$var; | ||||
54 | local $$var; | ||||
55 | $$var = defined $value ? $value : ${"YAML::$option"}; | ||||
56 | } | ||||
57 | return &{"$implementation\::Dump"}(@_); | ||||
58 | } | ||||
59 | |||||
60 | sub DumpFile { | ||||
61 | 2 | 13µs | 2 | 16µs | # spent 11µs (5+6) within YAML::Any::BEGIN@61 which was called:
# once (5µs+6µs) by BenchmarkAnything::Config::_read_config at line 61 # spent 11µs making 1 call to YAML::Any::BEGIN@61
# spent 6µs making 1 call to strict::unimport |
62 | 2 | 62µs | 2 | 15µs | # spent 9µs (4+6) within YAML::Any::BEGIN@62 which was called:
# once (4µs+6µs) by BenchmarkAnything::Config::_read_config at line 62 # spent 9µs making 1 call to YAML::Any::BEGIN@62
# spent 6µs making 1 call to warnings::unimport |
63 | my $implementation = __PACKAGE__->implementation; | ||||
64 | for my $option (@dump_options) { | ||||
65 | my $var = "$implementation\::$option"; | ||||
66 | my $value = $$var; | ||||
67 | local $$var; | ||||
68 | $$var = defined $value ? $value : ${"YAML::$option"}; | ||||
69 | } | ||||
70 | return &{"$implementation\::DumpFile"}(@_); | ||||
71 | } | ||||
72 | |||||
73 | # spent 32.1ms (23µs+32.1) within YAML::Any::Load which was called:
# once (23µs+32.1ms) by BenchmarkAnything::Config::_read_config at line 39 of BenchmarkAnything/Config.pm | ||||
74 | 2 | 13µs | 2 | 16µs | # spent 10µs (4+6) within YAML::Any::BEGIN@74 which was called:
# once (4µs+6µs) by BenchmarkAnything::Config::_read_config at line 74 # spent 10µs making 1 call to YAML::Any::BEGIN@74
# spent 6µs making 1 call to strict::unimport |
75 | 2 | 56µs | 2 | 14µs | # spent 9µs (4+5) within YAML::Any::BEGIN@75 which was called:
# once (4µs+5µs) by BenchmarkAnything::Config::_read_config at line 75 # spent 9µs making 1 call to YAML::Any::BEGIN@75
# spent 5µs making 1 call to warnings::unimport |
76 | 1 | 3µs | 1 | 31.8ms | my $implementation = __PACKAGE__->implementation; # spent 31.8ms making 1 call to YAML::Any::implementation |
77 | 1 | 2µs | for my $option (@load_options) { | ||
78 | 2 | 1µs | my $var = "$implementation\::$option"; | ||
79 | 2 | 3µs | my $value = $$var; | ||
80 | 2 | 900ns | local $$var; | ||
81 | 2 | 4µs | $$var = defined $value ? $value : ${"YAML::$option"}; | ||
82 | } | ||||
83 | 1 | 212µs | 1 | 204µs | return &{"$implementation\::Load"}(@_); # spent 204µs making 1 call to YAML::XS::LibYAML::Load |
84 | } | ||||
85 | |||||
86 | sub LoadFile { | ||||
87 | 2 | 15µs | 2 | 16µs | # spent 11µs (5+6) within YAML::Any::BEGIN@87 which was called:
# once (5µs+6µs) by BenchmarkAnything::Config::_read_config at line 87 # spent 11µs making 1 call to YAML::Any::BEGIN@87
# spent 6µs making 1 call to strict::unimport |
88 | 2 | 147µs | 2 | 13µs | # spent 9µs (4+5) within YAML::Any::BEGIN@88 which was called:
# once (4µs+5µs) by BenchmarkAnything::Config::_read_config at line 88 # spent 9µs making 1 call to YAML::Any::BEGIN@88
# spent 5µs making 1 call to warnings::unimport |
89 | my $implementation = __PACKAGE__->implementation; | ||||
90 | for my $option (@load_options) { | ||||
91 | my $var = "$implementation\::$option"; | ||||
92 | my $value = $$var; | ||||
93 | local $$var; | ||||
94 | $$var = defined $value ? $value : ${"YAML::$option"}; | ||||
95 | } | ||||
96 | return &{"$implementation\::LoadFile"}(@_); | ||||
97 | } | ||||
98 | |||||
99 | # spent 1µs within YAML::Any::order which was called:
# once (1µs+0s) by YAML::Any::implementation at line 106 | ||||
100 | return @YAML::Any::_TEST_ORDER | ||||
101 | 1 | 300ns | if @YAML::Any::_TEST_ORDER; | ||
102 | 1 | 2µs | return @implementations; | ||
103 | } | ||||
104 | |||||
105 | # spent 31.8ms (668µs+31.2) within YAML::Any::implementation which was called:
# once (668µs+31.2ms) by YAML::Any::Load at line 76 | ||||
106 | 1 | 1µs | 1 | 1µs | my @order = __PACKAGE__->order; # spent 1µs making 1 call to YAML::Any::order |
107 | 1 | 500ns | for my $module (@order) { | ||
108 | 1 | 200ns | my $path = $module; | ||
109 | 1 | 4µs | 1 | 2µs | $path =~ s/::/\//g; # spent 2µs making 1 call to YAML::Any::CORE:subst |
110 | 1 | 300ns | $path .= '.pm'; | ||
111 | 1 | 500ns | return $module if exists $INC{$path}; | ||
112 | 1 | 24µs | eval "require $module; 1" and return $module; # spent 38µs executing statements in string eval | ||
113 | } | ||||
114 | croak("YAML::Any couldn't find any of these YAML implementations: @order"); | ||||
115 | } | ||||
116 | |||||
117 | sub croak { | ||||
118 | require Carp; | ||||
119 | Carp::croak(@_); | ||||
120 | } | ||||
121 | |||||
122 | 1 | 4µs | 1; | ||
# spent 2µs within YAML::Any::CORE:subst which was called:
# once (2µs+0s) by YAML::Any::implementation at line 109 |