Benchmark::Chart - Plots your Benchmark
Version 0.01
Benchmark::Chart plots your Benchmark(s) using Gnuplot. If you are not familiar with module Benchmark, please study that first.
Common usage:
use Benchmark qw/:all/; use Benchmark::Chart qw/plotthese/; sub createSubs { my $x = shift; return { 'x * x' => sub { $x * $x }, 'x ^ 2' => sub { $x**2 }, }; } # functional interface my $result = timethese( 20000000, createSubs( 9467443 ), 'none' ); plotthese( options => { title => "My cool benchmark", output => "benchmark1.png", }, data => $result ); # or if you have more data my %inputs = ( '9999999' => 9999999, '88888888888' => 88888888888, '777777777777777777777' => 777777777777777777777, ); my @results; for my $k ( keys %inputs ) { push @results, { $k => timethese( 20000000, createSubs( $inputs{$k} ), 'none' ) }; } plotthese( options => { title => "My cool benchmark", output => "benchmark2.png", }, data => \@results );
plotthese on demand
Arguments passed to Chart::Gnuplot, see Chart::Gnuplot fore more information.
If true and plotting multiple benchmarks, then the performence will be converted to %.
Single benchmark: data is Hash containing Benchmarks as values and keys as a labels.
Multiple benchmarks. Array items are hashes with keys as a labels of benchmarked data, values are HashRefs (data is HashRef above).
Tomas Dohnalek, <dohnto at gmail.com>
<dohnto at gmail.com>
Please report any bugs or feature requests to bug-benchmark-chart at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Benchmark-Chart. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-benchmark-chart at rt.cpan.org
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
Copyright (C) 2014 Tomas Dohnalek <dohnto@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
To install Benchmark::Chart, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Benchmark::Chart
CPAN shell
perl -MCPAN -e shell install Benchmark::Chart
For more information on module installation, please visit the detailed CPAN module installation guide.