summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2020-03-15 20:51:36 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2020-03-15 20:51:36 (GMT)
commit0cdf95fd770c59a018a4018e49aa777d3ed34e45 (patch) (side-by-side diff)
tree8b7fddb81a444735901d34f5c69806fe98cf68eb
parenta39bd26c6d6d5638407e57caaa3187aeb52517b1 (diff)
downloadcache-benchmarks-0cdf95fd770c59a018a4018e49aa777d3ed34e45.tar.gz
cache-benchmarks-0cdf95fd770c59a018a4018e49aa777d3ed34e45.tar.bz2
Use actual min and max times for errorbar. Limit the maxcache value by the number of buckets in the db plus 100.
Diffstat (more/less context) (ignore whitespace changes)
m---------gdbm/newcache0
-rw-r--r--src/benchmark.mk.in2
-rw-r--r--src/gnuplot.m48
-rwxr-xr-xsrc/runtest39
4 files changed, 30 insertions, 19 deletions
diff --git a/gdbm/newcache b/gdbm/newcache
-Subproject 1f94a81a9f3a9955ca74dff07b7909595a85048
+Subproject 02bc2dc9bee96c0e7d93d23c6f0b7a24d0e1756
diff --git a/src/benchmark.mk.in b/src/benchmark.mk.in
index 9d8adff..5e02f11 100644
--- a/src/benchmark.mk.in
+++ b/src/benchmark.mk.in
@@ -28,7 +28,7 @@ test: master.log newcache.log
sed -n -e '2{' \
-e 's/.*Buckets = //' \
-e 's/\.$$//' \
- -e 'p}') * 2))} \
+ -e 'p}') + 100))} \
--log-file=$*.log \
$(abs_top_builddir)/src/$*/fetchkeys
clean:
diff --git a/src/gnuplot.m4 b/src/gnuplot.m4
index 29126f5..392eb94 100644
--- a/src/gnuplot.m4
+++ b/src/gnuplot.m4
@@ -12,14 +12,14 @@ set style line 3 linecolor rgb "blue" linewidth 1.000 dashtype solid pointtype 1
set style line 4 linecolor rgb "#0072b2" linewidth 1.000 dashtype solid pointtype 1 pointsize default pointinterval 0
plot "master.log" \
- using 1:4:7 \
+ using 1:8:9:10 \
title "GDBM 1.18.1" with errorbars ls 1, \
- "" using 1:4 \
+ "" using 1:8 \
notitle \
smooth csplines ls 2, \
"newcache.log" \
- using 1:4:7 \
+ using 1:8:9:10 \
title "GDBM newcache" with errorbars ls 3, \
- "" using 1:4 \
+ "" using 1:8 \
notitle \
smooth csplines ls 4
diff --git a/src/runtest b/src/runtest
index 7c8885c..2a24481 100755
--- a/src/runtest
+++ b/src/runtest
@@ -16,14 +16,33 @@ my $c_final = 100; # Final cache capacity.
my $drop_caches; # Drop system disk caches before each run.
my $log_file; # Name of the log file.
+use constant {
+ AVG => 0,
+ MIN => 1,
+ MAX => 2
+};
+
+sub init_times {
+ my ($t) = @_;
+ $t->[AVG] = 0;
+ $t->[MIN] = 100;
+ $t->[MAX] = 0;
+}
+
+sub update_times {
+ my ($t, $v) = @_;
+ $t->[AVG] += $v;
+ $t->[MIN] = $v if $t->[MIN] > $v;
+ $t->[MAX] = $v if $t->[MAX] < $v;
+};
+
sub runtest {
use constant {
TOTAL => 0,
OPEN => 1,
LOOP => 2
};
- my @times = (0,0,0);
- my @stddev = (0,0,0);
+ my @times = ([0,100,0],[0,100,0],[0,100,0]);
my $n;
for ($n = 0; $n < $nsamples; $n++) {
@@ -46,13 +65,9 @@ sub runtest {
close PH;
if (@inbuf == 3) {
- $times[TOTAL] += $inbuf[TOTAL];
- $times[OPEN] += $inbuf[OPEN];
- $times[LOOP] += $inbuf[LOOP];
-
- $stddev[TOTAL] += $inbuf[TOTAL] ** 2;
- $stddev[OPEN] += $inbuf[OPEN] ** 2;
- $stddev[LOOP] += $inbuf[LOOP] ** 2;
+ update_times($times[TOTAL], $inbuf[TOTAL]);
+ update_times($times[OPEN], $inbuf[OPEN]);
+ update_times($times[LOOP], $inbuf[LOOP]);
} else {
while (my $s = shift(@inbuf)) {
print "$s\n";
@@ -60,11 +75,7 @@ sub runtest {
die "no timing info\n";
}
}
- for (my $i = 0; $i < @times; $i++) {
- $times[$i] /= $nsamples;
- $stddev[$i] = sqrt($stddev[$i] / $nsamples - $times[$i] ** 2);
- }
- return (@times, @stddev);
+ map { $_->[AVG] /= $nsamples; @$_ } @times;
}
GetOptions(

Return to:

Send suggestions and report system problems to the System administrator.