Dumbben...PerlEval(3)
π Dumbbench::Instance::PerlEval(3) β bestie edition π
okay so this is the Dumbbench::Instance::PerlEval page from the User Contributed Perl Documentation, and it's literally about benchmarking a lil string of Perl code. yes, that kind of benchmarking. timing your code so you can brag about it (or cry about it). no cap.
β¨ NAME β¨
Dumbbench::Instance::PerlEval β Benchmarks a string of Perl code π
πΈ SYNOPSIS πΈ
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::PerlEval->new(name => 'mauve', code => 'for(1..1e9){$i++}'),
# ... more things to benchmark ...
);
$bench->run();
# ...
not me writing a whole benchmark harness in like six lines. iconic behavior fr fr. π
π¦ DESCRIPTION π¦
This class inherits from Dumbbench::Instance and implements benchmarking of strings of Perl code using eval "". like, it takes your code-as-a-string and runs it over and over and times it. that's the whole vibe. π
π METHODS π
π new
Constructor that takes named arguments. classic.
In addition to the properties of the base class, the Dumbbench::Instance::PerlEval constructor requires a code parameter. The code needs to be a string that is suitable for passing repeatedly to string-eval. yes bestie, it's a string, not a coderef, don't come at me.
Optionally, you can provide a dry_run_code option. It has the same structure and purpose as the code option, but it is used for the dry-runs. By default, a simple eval is used for this, so it's unlikely you will need the dry-run unless you want to strip out the compile-time overhead of your code. iykyk. β¨
πΈ code
Returns the code string that was set during construction. that's it. that's the method. π
π dry_run_code
Returns the dry-run code string that was set during construction. short king method. π
β SEE ALSO β
DumbbenchDumbbench::InstanceDumbbench::Instance::CmdDumbbench::ResultBenchmarkNumber::WithErrordoes the Gaussian error propagation. math girlie behavior honestly. π§SOOTcan optionally generate histograms from the timing distributions. pretty graphs?? obsessed. π<http://en.wikipedia.org/wiki/Median_absolute_deviation>
π AUTHOR π
Steffen Mueller, <smueller@cpan.org> π«Ά
π 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.
so like, it's Perl-licensed, bestie. same terms as Perl itself. 5.8.1 or whatever newer 5 you've got lying around. slay. π
and that's the whole page!! this was perl v5.42.0, dated 2025-07-25, from your favorite manpage source. mwah π periodt. πβ¨
π¦ 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