Dumbben...ce::Cmd(3)

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

๐Ÿ’– 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 system builtin 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:

  • Dumbbench
  • Dumbbench::Instance
  • Dumbbench::Instance::PerlEval
  • Dumbbench::Instance::PerlSub
  • Dumbbench::Result

and also:

  • Benchmark
  • Number::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 (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