Krang::Benchmark - manages the running of benchmarks scripts


To create a new benchmark script, create a new .pl file in bench/:

  use Krang::ClassLoader Benchmark => qw(run_benchmark);
  run_benchmark(module => "Krang::Foo",
                name   => "name of benchmark here",
                count  => 1000,
                code   => sub { "some code to benchmark here" });
  run_benchmark(module => "Krang::Foo",
                name   => "name of another benchmark here",
                count  => 1000,
                code   => sub { "some code to benchmark here" });

To perform a benchmark run:

  make bench

If you want to name your benchmark run for later reference:

  make bench BENCH_NAME=some_name_here

If you want to run just one benchmark script:

  make bench BENCH_FILES=bench/

After doing at least two runs, use krang_bench to perform benchmark analysis between the last two runs:


Or pass in run names to do arbitrary comparisions:

  bin/krang_bench name1 name2


This module manages benchmarking for Krang, run using ``make bench''. This module works like the standard Benchmark module with a couple differences. First, it only cares about wallclock time, since per-process CPU time is useless for a database application. Second, it dumps the results to a file called 'bench.out'. This file can then be used to compare benchmark results from different versions of Krang, different data loads or across different machines. For analysis, see the bin/krang_bench program.