1Dumbbench::Instance(3)User Contributed Perl DocumentationDumbbench::Instance(3)
2
3
4

NAME

6       Dumbbench::Instance - A benchmark instance within a Dumbbench
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::Cmd->new(name => 'mauve', command => [qw(perl -e 'something')]),
17           # ... more things to benchmark ...
18         );
19         $bench->run();
20         # ...
21

DESCRIPTION

23       This module is the base class for all benchmark instances. For example,
24       for benchmarking external commands, you should use
25       Dumbbench::Instance::Cmd.
26
27       The synopsis shows how instances of subclasses of "Dumbbench::Instance"
28       are added to a benchmark run.
29

METHODS

31   new
32       Constructor that takes named arguments. In this base class, the only
33       recognized argument is an instance "name".
34
35   timings
36       Returns the internal array reference of timings or undef if there
37       aren't any.
38
39   dry_timings
40       Same as "timings" but for dry-run timings.
41
42   name
43       Returns the name of the instance.
44
45   clone
46       Returns a full (deep) copy of the object. May have to be augmented in
47       subclasses.
48
49   single_run
50       Needs to be implemented in subclasses: A method that performs a single
51       benchmark run and returns the duration of the run in seconds.
52
53   single_dry_run
54       Needs to be implemented in subclasses: A method that performs a single
55       dry-run and returns the duration of the run in seconds.
56
57   timings_as_histogram
58       If the optional SOOT module is installed, "Dumbbench" can generate
59       histograms of the timing distributions.
60
61       This method creates such a histogram object (of type "TH1D") and
62       returns it. If "SOOT" is not available, this method returns the empty
63       list.
64
65   dry_timings_as_histogram
66       Same as "timings_as_histogram", but for the timings from dry-runs.
67

SEE ALSO

69       Dumbbench
70
71       Dumbbench::Instance::Cmd, Dumbbench::Instance::PerlEval,
72       Dumbbench::Instance::PerlSub
73
74       Dumbbench::Result
75
76       Benchmark
77
78       Number::WithError does the Gaussian error propagation.
79
80       SOOT can optionally generate histograms from the timing distributions.
81
82       <http://en.wikipedia.org/wiki/Median_absolute_deviation>
83

AUTHOR

85       Steffen Mueller, <smueller@cpan.org>
86
88       Copyright (C) 2010 by Steffen Mueller
89
90       This library is free software; you can redistribute it and/or modify it
91       under the same terms as Perl itself, either Perl version 5.8.1 or, at
92       your option, any later version of Perl 5 you may have available.
93
94
95
96perl v5.38.0                      2023-07-20            Dumbbench::Instance(3)
Impressum