Dumbben...Instance(3)

๐Ÿ“ฆ
version 0.505 ยท 2 versions
, in fedora 43

๐Ÿ’– Dumbbench::Instance โ€” the perl manpage but make it a group chat ๐Ÿ’–

User Contributed Perl Documentation โœจ Dumbbench...Instance(3)


๐ŸŒธ NAME ๐ŸŒธ

Dumbbench::Instance โ€” a benchmark instance living inside a Dumbbench, bestie ๐Ÿ’…


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

okay so like, here's the vibe:

use Dumbbench;

my $bench = Dumbbench->new(
  target_rel_precision => 0.005, # seek ~0.5%
  initial_runs         => 20,    # the higher the more reliable
);
$bench->add_instances(
  Dumbbench::Instance::Cmd->new(name => 'mauve', command => [qw(perl -e 'something')]),
  # ... more things to benchmark ...
);
$bench->run();
# ...

no cap, that's the whole flow ๐Ÿซถ


โœจ DESCRIPTION โœจ

This module is the base class for all benchmark instances. So if you wanna benchmark external commands, for example, you should be reaching for Dumbbench::Instance::Cmd instead, iykyk.

The synopsis up there shows how instances of subclasses of Dumbbench::Instance get added to a benchmark run. that's it, that's the tea โ˜•


๐Ÿ‘‘ METHODS ๐Ÿ‘‘

๐Ÿฆ‹ new

Constructor that takes named arguments. In this base class, the only recognized argument is an instance name.

๐Ÿฆ‹ timings

Returns the internal array reference of timings, or undef if there aren't any. literally just hands you the arrayref.

๐Ÿฆ‹ dry_timings

Same as timings but for dry-run timings. ๐Ÿ’€ yes there are two of them.

๐Ÿฆ‹ name

Returns the name of the instance. that's it. that's the whole method. iconic.

๐Ÿฆ‹ clone

Returns a full (deep) copy of the object. May have to be augmented in subclasses โ€” so heads up if you're subclassing, bestie.

๐Ÿฆ‹ single_run

Needs to be implemented in subclasses: a method that performs a single benchmark run and returns the duration of the run in seconds. โฑ๏ธ

not me leaving this abstract for you to fill in ๐Ÿ™ˆ

๐Ÿฆ‹ single_dry_run

Needs to be implemented in subclasses: a method that performs a single dry-run and returns the duration of the run in seconds. โฑ๏ธ

๐Ÿฆ‹ timings_as_histogram

If the optional SOOT module is installed, Dumbbench can generate histograms of the timing distributions. ๐Ÿ“Š

This method creates such a histogram object (of type TH1D) and returns it. If SOOT is not available, this method returns the empty list. periodt.

๐Ÿฆ‹ dry_timings_as_histogram

Same as timings_as_histogram, but for the timings from dry-runs. ๐Ÿ’–


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

  • Dumbbench
  • Dumbbench::Instance::Cmd, Dumbbench::Instance::PerlEval, Dumbbench::Instance::PerlSub
  • Dumbbench::Result
  • Benchmark
  • Number::WithError does the Gaussian error propagation. ๐Ÿงฎ
  • SOOT can optionally generate histograms from the timing distributions.
  • <http://en.wikipedia.org/wiki/Median_absolute_deviation>

๐Ÿซถ AUTHOR ๐Ÿซถ

Steffen Mueller, <smueller@cpan.org> โ€” shoutout to the author, main character energy fr fr ๐Ÿ’œ


Copyright (C) 2010 by Steffen Mueller

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available.


and that's the whole page, bestie ๐Ÿฅฐ this was perl v5.42.0, dated 2025-07-25 โ€” slay, stay benchmarking, mwah ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from