Dumbben...ce::Cmd(3)
๐ Dumbbench::Instance::Cmd ๐
okay bestie, gather round, because this is the Dumbbench::Instance::Cmd page from the User Contributed Perl Documentation โ it's a whole module for benchmarking external commands, and honestly? it's giving โจscienceโจ.
๐ธ NAME ๐ธ
Dumbbench::Instance::Cmd โ it benchmarks an external command. that's it, that's the whole vibe. you point it at a command, it runs it a bunch, and it tells you how long it took. no cap. ๐
๐ SYNOPSIS ๐
here's the whole thing in action, copy it exactly bestie:
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();
# ...
like, look at those comments. # seek ~0.5% and # the higher the more reliable. we love a self-documenting moment. ๐ซถ
๐ฆ DESCRIPTION ๐ฆ
so this class inherits from Dumbbench::Instance and its whole personality is implementing benchmarking of external commands. if you've got some random binary or shell thing you want to time, this is the girl for the job. ๐ฅ
๐ METHODS ๐
โญ new โญ
the constructor, and it takes named arguments. so fancy.
on top of everything you already get from the base class, the Dumbbench::Instance::Cmd constructor requires a command parameter. and command can be one of two things:
- a string specifying the external command along with its options, or
- (preferably, bestie, listen to her) a reference to an array of command-name and options โ literally exactly like the ordinary
systembuiltin does it. ๐ง
optionally, you can also hand her a dry_run_command option. it has the same structure and purpose as the command option, except it gets used for the dry-runs instead. and if you don't specify dry_run_command? the dry-run will just be starting another process that immediately exits. short queen. she did her job and left. ๐
๐ command ๐
returns the command that was set on object construction. that's the tea. โ
๐ธ dry_run_command ๐ธ
returns the command that was set for dry-runs on object construction. yes, it's the same energy as the last one but for the dry-run girlies. ๐
๐ SEE ALSO ๐
go read these too, they're all iconic in their own way:
DumbbenchDumbbench::InstanceDumbbench::Instance::PerlEvalDumbbench::Instance::PerlSubDumbbench::Result
and also:
BenchmarkNumber::WithErrorโ does the Gaussian error propagation. she's the math one. ๐งฎSOOTโ can optionally generate histograms from the timing distributions. pretty. ๐<http://en.wikipedia.org/wiki/Median_absolute_deviation>โ go learn about median absolute deviation, it's lowkey important for understanding what these numbers even mean. iykyk.
โจ AUTHOR โจ
Steffen Mueller, <smueller@cpan.org> โ thank you king, we appreciate you. ๐ซก
๐ COPYRIGHT AND LICENSE ๐
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.
fr fr, same terms as Perl itself. 5.8.1 or later, your call. ๐ฉท
okay that's the whole page bestie, and for the cute sign-off: this is from perl v5.42.0, dated 2025-07-25, filed under Dumbben...ce::Cmd(3). go benchmark something and slay. ๐
๐โจ
๐ฆ where this page comes from
- fedora 43: perl-Dumbbench 0.505-3.fc43 ยท GPL-1.0-or-later OR Artistic-1.0-Perl
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms