1Dumbbench::Instance::PeUrsleSrubC(o3n)tributed Perl DocuDmuemnbtbaetnicohn::Instance::PerlSub(3)
2
3
4

NAME

6       Dumbbench::Instance::PerlSub - Benchmarks a Perl code reference
7

SYNOPSIS

9         use Dumbbench;
10
11         my $bench = Dumbbench->new(
12           target_rel_precision => 0.005, # seek ~0.5%
13           initial_runs         => 20,    # the higher the more reliable
14         );
15         $bench->add_instances(
16           Dumbbench::Instance::PerlSub->new(name => 'mauve', code => sub {...}),
17           # ... more things to benchmark ...
18         );
19         $bench->run();
20         # ...
21

DESCRIPTION

23       This class inherits from Dumbbench::Instance and implements
24       benchmarking of Perl code references.
25

METHODS

27   new
28       Constructor that takes named arguments.
29
30       In addition to the properties of the base class, the
31       "Dumbbench::Instance::PerlSub" constructor requires a "code" parameter.
32       The "code" needs to be subroutine reference.
33
34       Optionally, you can provide a "dry_run_code" option.  It has the same
35       structure and purpose as the "code" option, but it is used for the dry-
36       runs. By default, an empty sub is used for this, so it's unlikely you
37       will need the dry-run unless you want to strip out some particular
38       overhead.
39
40   code
41       Returns the code string that was set during construction.
42
43   dry_run_code
44       Returns the dry-run code string that was set during construction.
45

SEE ALSO

47       Dumbbench, Dumbbench::Instance, Dumbbench::Instance::PerlEval,
48       Dumbbench::Instance::Cmd, Dumbbench::Result
49
50       Benchmark
51
52       Number::WithError does the Gaussian error propagation.
53
54       SOOT can optionally generate histograms from the timing distributions.
55
56       <http://en.wikipedia.org/wiki/Median_absolute_deviation>
57

AUTHOR

59       Steffen Mueller, <smueller@cpan.org>
60
62       Copyright (C) 2010 by Steffen Mueller
63
64       This library is free software; you can redistribute it and/or modify it
65       under the same terms as Perl itself, either Perl version 5.8.1 or, at
66       your option, any later version of Perl 5 you may have available.
67
68
69
70perl v5.32.1                      2021-01-27   Dumbbench::Instance::PerlSub(3)
Impressum