aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-03-15 22:51:36 +0200
committerSergey Poznyakoff <gray@gnu.org>2020-03-15 22:51:36 +0200
commit0cdf95fd770c59a018a4018e49aa777d3ed34e45 (patch)
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.
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
@@ -30,3 +30,3 @@ test: master.log newcache.log
-e 's/\.$$//' \
- -e 'p}') * 2))} \
+ -e 'p}') + 100))} \
--log-file=$*.log \
diff --git a/src/gnuplot.m4 b/src/gnuplot.m4
index 29126f5..392eb94 100644
--- a/src/gnuplot.m4
+++ b/src/gnuplot.m4
@@ -14,5 +14,5 @@ set style line 4 linecolor rgb "#0072b2" linewidth 1.000 dashtype solid pointtyp
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 \
@@ -20,5 +20,5 @@ plot "master.log" \
"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 \
diff --git a/src/runtest b/src/runtest
index 7c8885c..2a24481 100755
--- a/src/runtest
+++ b/src/runtest
@@ -18,2 +18,22 @@ 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 {
@@ -24,4 +44,3 @@ sub runtest {
};
- my @times = (0,0,0);
- my @stddev = (0,0,0);
+ my @times = ([0,100,0],[0,100,0],[0,100,0]);
@@ -48,9 +67,5 @@ sub runtest {
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 {
@@ -62,7 +77,3 @@ sub runtest {
}
- 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;
}

Return to:

Send suggestions and report system problems to the System administrator.