← Index
NYTProf Performance Profile   « line view »
For bin/benchmark-perlformance
  Run on Fri Apr 17 15:31:48 2015
Reported on Fri Apr 17 15:32:02 2015

Filename/home/ss5/local/projects/Benchmark-Perl-Formance/bin/benchmark-perlformance
StatementsExecuted 5 statements in 518µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1119.68ms120msmain::::BEGIN@5 main::BEGIN@5
7355117µs117µsUNIVERSAL::::isaUNIVERSAL::isa (xsub)
88572µs72µsUNIVERSAL::::VERSIONUNIVERSAL::VERSION (xsub)
521138µs38µsInternals::::SvREADONLYInternals::SvREADONLY (xsub)
331135µs35µsmro::::method_changed_in mro::method_changed_in (xsub)
1116µs6µsversion::::(bool version::(bool (xsub)
1114µs4µsversion::::(cmp version::(cmp (xsub)
0000s0smain::::RUNTIME main::RUNTIME
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
012µsProfile data that couldn't be associated with a specific line:
# spent 2µs making 1 call to Class::XSAccessor::END
1#! /usr/bin/perl
2# PODNAME: benchmark-perlformance
3# ABSTRACT: Frontend for Benchmark::Perl::Formance
4
52486µs1120ms
# spent 120ms (9.68+110) within main::BEGIN@5 which was called: # once (9.68ms+110ms) by main::RUNTIME at line 5
use Benchmark::Perl::Formance;
# spent 120ms making 1 call to main::BEGIN@5
6
714µs110µsmy $pf = Benchmark::Perl::Formance->new;
# spent 10µs making 1 call to Benchmark::Perl::Formance::new
8
913µs15.55smy $results = $pf->run;
# spent 5.55s making 1 call to Benchmark::Perl::Formance::run
10125µs110.2ms$pf->print_results($results);
# spent 10.2ms making 1 call to Benchmark::Perl::Formance::print_results
11
12=pod
13
14=head1 ABOUT
15
16This is the frontend commandline tool for starting the performance
17benchmark runs.
18
19After running it prints out the results which you can take to compare
20them to runs with other Perl versions, other architectures, different
21compile time configuration or on different machines.
22
23=head1 SYNOPSIS
24
25Usage:
26
27 $ benchmark-perlformance
28 $ benchmark-perlformance --plugins=SpamAssassin,Fib,Rx
29 $ benchmark-perlformance --plugins=SpamAssassin,Fib,Rx -q
30 $ benchmark-perlformance --plugins=SpamAssassin,Fib,Rx -v
31 $ benchmark-perlformance --plugins=SpamAssassin,Fib,Rx -vv -ccccc
32
33If run directly it uses the perl in your PATH:
34
35 $ /path/to/benchmark-perlformance
36
37
38To use another Perl start it via
39
40 $ /other/path/to/bin/perl /path/to/benchmark-perlformance
41
42To provide configuration, general and plugin specific, you can use the
43C<-D> option to define key/value pairs:
44
45 $ benchmark-perlformance -DShootout_fasta_n=5500 [...]
46
47Plugins usually follow the convention that the options are prefixed
48with the plugin name, like in the example it means the config value
49C<n> used by the plugin C<Shootout::fasta>.
50
51=head1 OPTIONS
52
53There are some options available.
54
55=over 4
56
57=item --help
58
59=item -h
60
61prints out a help page.
62
63=item --plugins=SpamAssassin,Fib,Rx
64
65Use only a particular list of sub benchmarks. The comma-separated list
66refers to C<Benchmark::Perl::Formance::Plugin::*> respectively.
67
68If you provide C<--plugins=ALL> then all known plugins will be tried.
69
70If you do not provide the C<--plugins> option then a default list of
71"mostly harmless" plugins is used which should work with the same
72dependencies of Benchmark::Perl::Formance itself (currently: C<DPath>,
73C<Fib>, C<FibOO>, C<Mem>, C<Prime>, C<Rx>, C<Shootout::>{C<fasta>,
74C<regexdna>, C<binarytrees>, C<revcomp>, C<nbody>, C<spectralnorm>}).
75
76=item --outstyle=summary
77
78This enables a condensed tabular output instead of YAML.
79Default since v0.10.
80
81=item --outstyle=yaml
82
83This activates YAML formatted output.
84
85=item --fastmode
86
87If this is set then some plugins try to scale down the stress to take
88less time (with less useful results, of course). Mostly for easier
89development.
90
91=item --stabilize-cpu
92
93Runs an external utility script
94(C<benchmark-perlformance-set-stable-system>) which stabilizes the
95system to get less deviation on multiple runs.
96
97The system is stabilized using:
98
99=over 4
100
101=item * Disable address space randomization (ASLR)
102
103See L<https://wiki.ubuntu.com/Security/Features>
104
105=item * Set maximum frequency of all cpus to minimum frequency
106
107Therefore the system can't scale down further unexpectedly, e.g. when
108it gets hot.
109
110=item * Drop caches
111
112See L<http://linux-mm.org/Drop_Caches>.
113
114=item * Classical disk sync
115
116Flush file system buffers, see C<man 1 sync>.
117
118=back
119
120The external utility script is called via C<sudo> - please configure
121your sudo in advance to suit your needs, e.g. to not ask for
122password. An alternative approach is to run
123C<benchmark-perlformance-set-stable-system lo> once when your system
124boots, like from C</etc/init.d/> (and run your cpu slow all the time,
125obviously).
126
127B<Be careful>: maybe the cpu is not restored perfectly after a run,
128e.g., due to crashes during the benchmarking, or the values are not
129the very same. This could make your next results without
130C<--stabilize-cpu> inconclusive. Reboot your system to ensure a clean
131state or use C<--stabilize-cpu> all the time.
132
133=item --version
134
135Print Benchmark::Perl::Formance version.
136In conjunction with C<-v> it prints out all available
137plugins with version.
138
139=item --verbose
140
141=item -v
142
143=item -vv
144
145=item -vvv
146
147=item -vvvv
148
149=item -vvvvv
150
151Increases the verbosity level during the run of the
152benchmarks. Default is only print the result (and maybe some output
153from external tools).
154
155To increase the number of keys from your Perl Config that are included
156in the result use one or more -c options.
157
158Please note that only one single -v is not enough to see errors that
159occur when trying to load a plugin. They are only marked as
160"skipped". Use -vv to see the error message; -vvv for progress
161information; -vvvv or more should be used for debugging info.
162
163=item -q
164
165Be quiet; do not output results.
166
167=item --showconfig
168
169=item -c
170
171Gives you the most basic information like Perl version, operating
172system name and architecture, i.e., C<perlpath>, C<version>,
173C<archname>, C<archname64>, C<osvers>.
174
175=item -cc
176
177Adds C<gccversion>, C<gnulibc_version>, C<usemymalloc>,
178C<config_args>, C<optimize>.
179
180=item -ccc
181
182Adds C<ccflags>, C<ccname>, C<cccdlflags>, C<ccdlflags>, C<cppflags>, C<nm_so_opt>.
183
184=item -cccc
185
186Adds about 40 more keys from Perl's %Config hash - everything that
187sounds like it could either influence performance between different
188hardware, configurations, and compilers, or interesting meta
189information around that.
190
191=item -ccccc
192
193Includes all info from Perl's %Config hash.
194
195=item -p
196
197Includes platform info via Devel::Platform::Info
198
199(Users who want to greet the 80s combine it this way: C<-cccp>. :-)
200
201=item --tapdescription="some description"
202
203When given this will prepend the YAML with a TAP line
204
205 ok some description
206
207This makes it easier for wrappers to embed the output into TAP which
208otherwise need to differentiate between output (verbose and other) and
209the YAML.
210
211=item --indent=2
212
213This indents the whole yaml output by some spaces (2 in the
214example). Together with C<--tapdescription> it makes an TAP v13 style
215structured diagnostics block which can, for instance, be evaluated
216using L<TAP::DOM>.
217
218=item --useforks
219
220By setting this you can activate the C<forks> drop-in replacement for
221threads.
222
223See
224L<Benchmark::Perl::Formance::Plugin::Threads|Benchmark::Perl::Formance::Plugin::Threads>.
225
226=item -Dkey=value
227
228With this you can configure some plugins by defining key/value pairs.
229
230=back
231
232=head1 ENVIRONMENT VARIABLES
233
234There are some options available.
235
236=over 4
237
238=item PERLFORMANCE_SALEARN
239
240See L<Benchmark::Perl::Formance::Plugin::SpamAssassin|Benchmark::Perl::Formance::Plugin::SpamAssassin>. Contains
241the path to the "sa-learn" executable.
242
243=item PERLFORMANCE_THREADCOUNT
244
245See
246L<Benchmark::Perl::Formance::Plugin::Threads|Benchmark::Perl::Formance::Plugin::Threads>. Use
247this many count of threads. Default is 16.
248
249=back
250
251=head1 PLUGINS
252
253Please read the documentation for the used plugins, as they might accept
254special configuration, usually via C<-Dkey=value> options.
255
256=over 4
257
258=item L<Benchmark::Perl::Formance::Plugin::SpamAssassin|Benchmark::Perl::Formance::Plugin::SpamAssassin>
259
260Run Bayes learning tools from SpamAssassin.
261
262=item L<Benchmark::Perl::Formance::Plugin::Rx|Benchmark::Perl::Formance::Plugin::Rx>
263
264Stress using Perl6/Perl5 tools around STD.pm
265
266=item L<Benchmark::Perl::Formance::Plugin::DPath|Benchmark::Perl::Formance::Plugin::DPath>
267
268Use DPath to stress lookup, traversing and copying data structures.
269
270=item L<Benchmark::Perl::Formance::Plugin::Rx|Benchmark::Perl::Formance::Plugin::Rx>
271
272Regular expressions, basic functions and pathological regex stressing.
273
274=item L<Benchmark::Perl::Formance::Plugin::RxCmp|Benchmark::Perl::Formance::Plugin::RxCmp>
275
276Compare differnet regex engines (pluggable since Perl 5.10).
277
278=item L<Benchmark::Perl::Formance::Plugin::Fib|Benchmark::Perl::Formance::Plugin::Fib>
279
280Fibonnacci numbers to stress recursion and function calls.
281
282=item L<Benchmark::Perl::Formance::Plugin::FibOO|Benchmark::Perl::Formance::Plugin::FibOO>
283
284Fibonnacci numbers to stress recursion and method calls, with plain Perl OO.
285
286=item L<Benchmark::Perl::Formance::Plugin::FibMoose|Benchmark::Perl::Formance::Plugin::FibMoose>
287
288Fibonnacci numbers to stress recursion and method calls, with Moose.
289
290=item L<Benchmark::Perl::Formance::Plugin::FibMouse|Benchmark::Perl::Formance::Plugin::FibMouse>
291
292Fibonnacci numbers to stress recursion and method calls, with Mouse.
293
294=item L<Benchmark::Perl::Formance::Plugin::FibMXDeclare|Benchmark::Perl::Formance::Plugin::FibMXDeclare>
295
296Fibonnacci numbers to stress recursion and method calls, with MooseX::Declare.
297
298=item L<Benchmark::Perl::Formance::Plugin::Threads|Benchmark::Perl::Formance::Plugin::Threads>
299
300Thread handling.
301
302=item L<Benchmark::Perl::Formance::Plugin::Shootout|Benchmark::Perl::Formance::Plugin::Shootout>
303
304Runs some Perl benchmarks from the Language Shootout on
305alioth.debian.org.
306
307=item L<Benchmark::Perl::Formance::Plugin::P6STD|Benchmark::Perl::Formance::Plugin::P6STD>
308
309Runs tools from Perl6 STD world.
310
311=back
312
313=cut
314
 
# spent 38µs within Internals::SvREADONLY which was called 52 times, avg 733ns/call: # 52 times (38µs+0s) by constant::import at line 147 of constant.pm, avg 733ns/call
sub Internals::SvREADONLY; # xsub
# spent 72µs within UNIVERSAL::VERSION which was called 8 times, avg 9µs/call: # once (11µs+0s) by Data::DPath::Path::BEGIN@17 at line 17 of Data/DPath/Path.pm # once (10µs+0s) by Data::OptList::BEGIN@11 at line 11 of Data/OptList.pm # once (10µs+0s) by Exporter::Heavy::heavy_export at line 120 of Exporter/Heavy.pm # once (9µs+0s) by Exception::Class::Base::BEGIN@9 at line 9 of Exception/Class/Base.pm # once (9µs+0s) by Exception::Class::Base::BEGIN@10 at line 10 of Exception/Class/Base.pm # once (9µs+0s) by Sub::Exporter::BEGIN@11 at line 11 of Sub/Exporter.pm # once (6µs+0s) by Sub::Exporter::BEGIN@12 at line 12 of Sub/Exporter.pm # once (6µs+0s) by Sub::Exporter::BEGIN@13 at line 13 of Sub/Exporter.pm
sub UNIVERSAL::VERSION; # xsub
# spent 117µs within UNIVERSAL::isa which was called 73 times, avg 2µs/call: # 46 times (81µs+0s) by Devel::StackTrace::_ref_to_string at line 79 of Devel/StackTrace.pm, avg 2µs/call # 12 times (17µs+0s) by base::import at line 74 of base.pm, avg 1µs/call # 8 times (9µs+0s) by Exception::Class::Base::caught at line 209 of Exception/Class/Base.pm, avg 1µs/call # 4 times (6µs+0s) by Iterator::Util::imap at line 43 of Iterator/Util.pm, avg 2µs/call # 3 times (4µs+0s) by Exception::Class::_make_subclass at line 152 of Exception/Class.pm, avg 1µs/call
sub UNIVERSAL::isa; # xsub
# spent 35µs within mro::method_changed_in which was called 33 times, avg 1µs/call: # 33 times (35µs+0s) by constant::import at line 162 of constant.pm, avg 1µs/call
sub mro::method_changed_in; # xsub
# spent 6µs within version::(bool which was called: # once (6µs+0s) by Benchmark::Perl::Formance::BEGIN@8 at line 57 of Config.pm
sub version::(bool; # xsub
# spent 4µs within version::(cmp which was called: # once (4µs+0s) by Benchmark::Perl::Formance::BEGIN@8 at line 60 of Config.pm
sub version::(cmp; # xsub