summaryrefslogtreecommitdiff
path: root/toolbin/performance.pl
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2013-07-23 16:24:19 +0100
committerChris Liddell <chris.liddell@artifex.com>2015-07-20 18:21:17 +0100
commit6948650efd3fb9e2a70b8cf16aca57e9d0b7eb0a (patch)
tree5c2a1c671c1d4521f8a770d1e69e3d4342718030 /toolbin/performance.pl
parent7fd9e0be26e67c36f87733bc89ea07dc26d9f839 (diff)
downloadghostpdl-6948650efd3fb9e2a70b8cf16aca57e9d0b7eb0a.tar.gz
Commit of build_consolidation branch
Squashed into one commit (see branch for details of the evolution of the branch). This brings gpcl6 and gxps into the Ghostscript build system, and a shared set of graphics library object files for all the interpreters. Also, brings the same configuration options to the pcl and xps products as we have for Ghostscript.
Diffstat (limited to 'toolbin/performance.pl')
-rwxr-xr-xtoolbin/performance.pl71
1 files changed, 71 insertions, 0 deletions
diff --git a/toolbin/performance.pl b/toolbin/performance.pl
new file mode 100755
index 000000000..6603ecf03
--- /dev/null
+++ b/toolbin/performance.pl
@@ -0,0 +1,71 @@
+#!/usr/bin/perl
+
+#
+# this is a simple script that can be used to gather performance data from
+# different revisions of Ghostscript.
+#
+# the command line options for performance.pl are:
+#
+# shellScript - a simple shell script that calls Ghostscript, the format
+# is the same as used for search-svn-revs, for example:
+# bin/gs -Ilib -I/home/support/fonts -sDEVICE=ppmraw -dNOPAUSE -dBATCH -sOutputFile=test.out ../input.ps
+#
+# startRev - the first rev to test
+#
+# endRev - the last rev to test
+#
+# increment - revision increment
+#
+#
+# example command line (assuming the shellScript is called testscript):
+#
+# performance.pl testscript 8500 9500 10 >perf.log
+# - test every 10 revs from r8500 to r9500
+#
+# The output is formatted to make it easily plotted with gnuplot (rev tab time tab size_of_exe)
+
+
+use strict;
+use warnings;
+
+my $command=shift;
+my $startRev=shift;
+my $endRev=shift || die "usage: performance.pl shellScript startRev endRev [increment]";
+my $increment=shift;
+$increment=1 if (!$increment);
+
+for (my $i=$startRev; $i<=$endRev; $i+=$increment) {
+ my $exe="gs.$i/bin/gs";
+ my $bad="gs.$i/does_not_build";
+ if (-e $bad) {
+ print STDERR "skipping r$i, build previously failed\n";
+ } else {
+ if (! -e $exe) {
+ print STDERR "fetching r$i\n";
+ my $s;
+ $s=sprintf "touch gs.%d ; rm -fr gs.%d ; svn export -r%d http://svn.ghostscript.com/ghostscript/trunk/gs gs.%d",$i,$i,$i,$i;
+ `$s`;
+ $s=sprintf "cd gs.%d ; ./autogen.sh 2>/dev/null ; make -j 2 2>/dev/null",$i;
+ `$s`;
+ if (! -e $exe) {
+ print STDERR "skipping r$i, build failed\n";
+ `touch $bad`;
+ }
+ } else {
+ print STDERR "already exists r$i\n";
+ }
+ }
+ if (-e $exe) {
+ my $size=-s $exe;
+ my $a=`cd gs.$i ; /home/marcos/bin/time -f "%U %S %E %P" ../$command 2>&1`;
+ my @a=split '\n',$a;
+ chomp $a[-1];
+ my $t=0;
+ if ($a[-1] =~ m/(\d+.\d+) (\d+.\d+)/) {
+ $t=$1+$2;
+ }
+ print "$i\t$t\t$size\n";
+ }
+}
+
+