Dumbben...PerlEval(3)

πŸ“¦
version 0.505 Β· 2 versions
, in fedora 43

πŸ’– 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 ⭐

  • Dumbbench
  • Dumbbench::Instance
  • Dumbbench::Instance::Cmd
  • Dumbbench::Result
  • Benchmark
  • Number::WithError does the Gaussian error propagation. math girlie behavior honestly. 🧚
  • SOOT can 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 (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