From 120f6de605b9a431e3b084bfc34d7cf33b6c9905 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 11 Apr 2013 12:51:06 +0000 Subject: Introduce some extra testing and benchmarking command-line options to the GTK front end, plus a 'make test' target in the GTK makefile which uses them to automatically generate 100 puzzles for each game at each preset configuration, test-run them back through the solver without their aux_info to ensure that can cope, and produce an HTML box plot of game generation times for each preset. As part of this work I've removed the TESTSOLVE mechanism from r9549, since the new --test-solve option does the same thing better (in that when something goes wrong it prints the random seed that caused the problem). [originally from svn r9825] [r9549 == 5a095b8a08fa9f087b93c86aea0fa027138b028d] --- benchmark.pl | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100755 benchmark.pl (limited to 'benchmark.pl') diff --git a/benchmark.pl b/benchmark.pl new file mode 100755 index 0000000..131faaf --- /dev/null +++ b/benchmark.pl @@ -0,0 +1,153 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +my @presets = (); +my %presets = (); +my $maxval = 0; + +while (<>) { + chomp; + if (/^(.*)(#.*): ([\d\.]+)$/) { + push @presets, $1 unless defined $presets{$1}; + push @{$presets{$1}}, $3; + $maxval = $3 if $maxval < $3; + } +} + +print < + + + +Puzzle generation-time benchmarks + + + +

Puzzle generation-time benchmarks

+ + +EOF + +for my $preset (@presets) { + print "\n"; +} + +print < + +EOF + +sub escape { + my ($text) = @_; + $text =~ s/&/&/g; + $text =~ s//>/g; + return $text; +} -- cgit v1.1
Preset
", &escape($preset), " $b } @{$presets{$preset}}; + print "]\" data-scale=\"$maxval\">