Bencher-Backend
view release on metacpan or search on metacpan
If set to a module name, will search for all (instead of the first
occurrence) of the module in @INC. Then will generate items for each
version.
Currently only one module can be multi version.
* multiperl => *bool* (default: 0)
Benchmark against multiple perls.
Requires App::perlbrew to be installed. Will use installed perls
from the perlbrew installation. Each installed perl must have
Bencher::Backend module installed (in addition to having all modules
that you want to benchmark, obviously).
By default, only perls having Bencher::Backend will be included. Use
"--include-perl" and "--exclude-perl" to include and exclude which
perls you want.
Also note that due to the way this is currently implemented,
benchmark code that contains closures (references to variables
outside the code) won't work.
* note => *str*
Put additional note in the result.
* on_failure => *str*
What to do when there is a failure.
For a command participant, failure means non-zero exit code. For a
Perl-code participant, failure means Perl code dies or (if expected
result is specified) the result is not equal to the expected result.
The default is "die". When set to "skip", will first run the code of
each item before benchmarking and trap command failure/Perl
exception and if that happens, will "skip" the item.
* on_result_failure => *str*
What to do when there is a result failure.
This is like "on_failure" except that it specifically refer to the
failure of item's result not being equal to expected result.
There is an extra choice of "warn" for this type of failure, which
is to print a warning to STDERR and continue.
* participants => *array[hash]*
Add participants.
* precision => *float*
Precision.
When benchmarking with the default Benchmark::Dumb runner, will pass
the precision to it. The value is a fraction, e.g. 0.5 (for 5%
precision), 0.01 (for 1% precision), and so on. Or, it can also be a
positive integer to speciify minimum number of iterations, usually
need to be at least 6 to avoid the "Number of initial runs is very
small (<6)" warning. The default precision is 0, which is to let
Benchmark::Dumb determine the precision, which is good enough for
most cases.
When benchmarking with Benchmark runner, will pass this value as the
$count argument. Which can be a positive integer to mean the number
of iterations to do (e.g. 10, or 100). Or, can also be set to a
negative number (e.g. -0.5 or -2) to mean minimum number of CPU
seconds. The default is -0.5.
When benchmarking with Benchmark::Dumb::SimpleTime, this value is a
positive integer which means the number of iterations to perform.
When profiling, a number greater than 1 will set a repetition loop
(e.g. "for(1..100){ ... }").
This setting overrides "default_precision" property in the scenario.
* precision_limit => *float*
Set precision limit.
Instead of setting "precision" which forces a single value, you can
also set this "precision_limit" setting. If the precision in the
scenario is higher (=number is smaller) than this limit, then this
limit is used. For example, if the scenario specifies
"default_precision" 0.001 and "precision_limit" is set to 0.005 then
0.005 is used.
This setting is useful on slower computers which might not be able
to reach the required precision before hitting maximum number of
iterations.
* raw => *bool*
Show "raw" data.
When action=show-items-result, will print result as-is instead of
dumping as Perl.
* render_as_benchmark_pm => *true*
Format result like Benchmark.pm.
* result_dir => *dirname*
Directory to use when saving benchmark result.
Default is from "BENCHER_RESULT_DIR" environment variable, or the
home directory.
* result_filename => *filename*
Filename to use when saving benchmark result.
Default is:
<NAME>.<yyyy-dd-dd-"T"HH-MM-SS>.json
or, when running in module startup mode:
<NAME>.module_startup.<yyyy-dd-dd-"T"HH-MM-SS>.json
or, when running in code startup mode:
<NAME>.code_startup.<yyyy-dd-dd-"T"HH-MM-SS>.json
where <NAME> is scenario module name, or "NO_MODULE" if scenario is
not from a module. The "::" (double colon in the module name will be
replaced with "-" (dash).
* return_meta => *bool*
Whether to return extra metadata.
When set to true, will return extra metadata such as platform
information, CPU information, system load before & after the
benchmark, system time, and so on. This is put in result metadata
under "func.*" keys.
The default is to true (return extra metadata) unless when run as
CLI and format is text (where the extra metadata is not shown).
* runner => *str*
Runner module to use.
The default is "Benchmark::Dumb" which should be good enough for
most cases.
You can use "Benchmark" runner ("Benchmark.pm") if you are
accustomed to it and want to see its output format.
You can use "Benchmark::Dumb::SimpleTime" if your participant code
runs for at least a few to many seconds and you want to use very few
iterations (like 1 or 2) because you don't want to wait for too
long.
* save_result => *bool*
Whether to save benchmark result to file.
Will also be turned on automatically if "BENCHER_RESULT_DIR"
environment variabl is defined.
When this is turned on, will save a JSON file after benchmark,
containing the result along with metadata. The directory of the JSON
file will be determined from the "results_dir" option, while the
filename from the "results_filename" option.
* scenario => *hash*
Load a scenario from data structure.
* scenario_file => *str*
Load a scenario from a Perl file.
Perl file will be do()'ed and the last expression should be a hash
containing the scenario specification.
* scenario_module => *perl::modname*
Load a scenario from a Bencher::Scenario:: Perl module.
Will try to load module "Bencher::Scenario::<NAME>" and expect to
find a package variable in the module called $scenario which should
be a hashref containing the scenario specification.
* scientific_notation => *bool*
(No description)
* sorts => *array[str]* (default: ["-time"])
(No description)
* test => *bool*
Whether to test participant code once first before benchmarking.
By default, participant code is run once first for testing (e.g.
whether it dies or return the correct result) before benchmarking.
If your code runs for many seconds, you might want to skip this test
and set this to 0.
* tidy => *bool*
Run perltidy over generated scripts.
* with_args_size => *bool*
Also return memory usage of item's arguments.
Memory size is measured using Devel::Size.
( run in 0.723 second using v1.01-cache-2.11-cpan-71847e10f99 )