View on
MetaCPAN
Steve Hay > perl > bench.pl

Download:
perl-5.24.2.tar.gz

Annotate this POD

Website

Source   Latest Release: perl-5.27.3

NAME ^

bench.pl - Compare the performance of perl code snippets across multiple perls.

SYNOPSIS ^

    # Basic: run the tests in t/perf/benchmarks against two or
    # more perls

    bench.pl [options] perl1[=label1] perl2[=label2] ...

    # Run bench.pl's own built-in sanity tests

    bench.pl --action=selftest

DESCRIPTION ^

By default, bench.pl will run code snippets found in t/perf/benchmarks (or similar) under cachegrind, in order to calculate how many instruction reads, data writes, branches, cache misses, etc. that one execution of the snippet uses. It will run them against two or more perl executables and show how much each test has gotten better or worse.

It is modelled on the perlbench tool, but since it measures instruction reads etc., rather than timings, it is much more precise and reproducible. It is also considerably faster, and is capable of running tests in parallel (with -j). Rather than displaying a single relative percentage per test/perl combination, it displays values for 13 different measurements, such as instruction reads, conditional branch misses etc.

There are options to write the raw data to a file, and to read it back. This means that you can view the same run data in different views with different selection and sort options.

The optional =label after each perl executable is used in the display output.

OPTIONS ^

syntax highlighting: