Dumbben...PerlSub(3)
π Dumbbench::Instance::PerlSub π
okay so bestie, welcome to the Dumbben...PerlSub(3) page from the User Contributed Perl Documentation collection. this is the one where you benchmark a Perl code reference. yes, that kind of benchmarking. the fancy statistical kind. put your hair up, we're doing science π
β¨ NAME β¨
Dumbbench::Instance::PerlSub β it benchmarks a Perl code reference, that's the whole job, and it ate π«Ά
π¦ SYNOPSIS π¦
like, just look at her:
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::PerlSub->new(name => 'mauve', code => sub {...}),
# ... more things to benchmark ...
);
$bench->run();
# ...
the comments in there are verbatim, don't come for me. target_rel_precision => 0.005 is chasing roughly 0.5%, and initial_runs => 20 is you saying "the higher the more reliable". no cap.
πΈ DESCRIPTION πΈ
so this class inherits from Dumbbench::Instance (iconic parent behavior) and it implements benchmarking of Perl code references. that's it. that's the vibe. you hand it a coderef, it does the timing thing. β¨
π METHODS π
π new
Constructor, and she takes named arguments. very demure, very mindful.
on top of all the properties from the base class, the Dumbbench::Instance::PerlSub constructor requires a code parameter. and that code needs to be a subroutine reference. not a string, not a vibe, a real coderef. π«Ά
optionally β like, if you want β you can also pass a dry_run_code option. same structure, same purpose as the code option, except it gets used for the dry-runs. by default an empty sub is used for that, so honestly you probably won't need the dry-run at all... unless you're trying to strip out some particular overhead. then it's giving custom dry-run energy. π§
π code
returns the code string that was set during construction. as in, whatever you handed it. that's it, that's the method.
π dry_run_code
returns the dry-run code string that was set during construction. same deal, different parameter. π
π SEE ALSO π
okay the whole friend group, no one gets left out:
DumbbenchDumbbench::InstanceDumbbench::Instance::PerlEvalDumbbench::Instance::CmdDumbbench::Result
and then the extended universe:
BenchmarkNumber::WithErrorβ she does the Gaussian error propagation, queen behavior πSOOTβ can optionally generate histograms from the timing distributions. obsessed.<http://en.wikipedia.org/wiki/Median_absolute_deviation>β the MAD page, iykyk
π 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.
fr fr, same terms as Perl itself. 5.8.1 or literally any later Perl 5 you've got. periodt. β¨
and that's the whole page, bestie π this was perl v5.42.0, dated 2025-07-25, and it's giving Dumbben...PerlSub(3) main character energy from start to finish. mwah ππ
π¦ 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