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
@@ -28,7 +28,7 @@ test: master.log newcache.log
28 sed -n -e '2{' \ 28 sed -n -e '2{' \
29 -e 's/.*Buckets = //' \ 29 -e 's/.*Buckets = //' \
30 -e 's/\.$$//' \ 30 -e 's/\.$$//' \
31 -e 'p}') * 2))} \ 31 -e 'p}') + 100))} \
32 --log-file=$*.log \ 32 --log-file=$*.log \
33 $(abs_top_builddir)/src/$*/fetchkeys 33 $(abs_top_builddir)/src/$*/fetchkeys
34clean: 34clean:
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
12set style line 4 linecolor rgb "#0072b2" linewidth 1.000 dashtype solid pointtype 1 pointsize default pointinterval 0 12set style line 4 linecolor rgb "#0072b2" linewidth 1.000 dashtype solid pointtype 1 pointsize default pointinterval 0
13 13
14plot "master.log" \ 14plot "master.log" \
15 using 1:4:7 \ 15 using 1:8:9:10 \
16 title "GDBM 1.18.1" with errorbars ls 1, \ 16 title "GDBM 1.18.1" with errorbars ls 1, \
17 "" using 1:4 \ 17 "" using 1:8 \
18 notitle \ 18 notitle \
19 smooth csplines ls 2, \ 19 smooth csplines ls 2, \
20 "newcache.log" \ 20 "newcache.log" \
21 using 1:4:7 \ 21 using 1:8:9:10 \
22 title "GDBM newcache" with errorbars ls 3, \ 22 title "GDBM newcache" with errorbars ls 3, \
23 "" using 1:4 \ 23 "" using 1:8 \
24 notitle \ 24 notitle \
25 smooth csplines ls 4 25 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.
16my $drop_caches; # Drop system disk caches before each run. 16my $drop_caches; # Drop system disk caches before each run.
17my $log_file; # Name of the log file. 17my $log_file; # Name of the log file.
18 18
19use constant {
20 AVG => 0,
21 MIN => 1,
22 MAX => 2
23};
24
25sub init_times {
26 my ($t) = @_;
27 $t->[AVG] = 0;
28 $t->[MIN] = 100;
29 $t->[MAX] = 0;
30}
31
32sub update_times {
33 my ($t, $v) = @_;
34 $t->[AVG] += $v;
35 $t->[MIN] = $v if $t->[MIN] > $v;
36 $t->[MAX] = $v if $t->[MAX] < $v;
37};
38
19sub runtest { 39sub runtest {
20 use constant { 40 use constant {
21 TOTAL => 0, 41 TOTAL => 0,
22 OPEN => 1, 42 OPEN => 1,
23 LOOP => 2 43 LOOP => 2
24 }; 44 };
25 my @times = (0,0,0); 45 my @times = ([0,100,0],[0,100,0],[0,100,0]);
26 my @stddev = (0,0,0);
27 46
28 my $n; 47 my $n;
29 for ($n = 0; $n < $nsamples; $n++) { 48 for ($n = 0; $n < $nsamples; $n++) {
@@ -46,13 +65,9 @@ sub runtest {
46 close PH; 65 close PH;
47 66
48 if (@inbuf == 3) { 67 if (@inbuf == 3) {
49 $times[TOTAL] += $inbuf[TOTAL]; 68 update_times($times[TOTAL], $inbuf[TOTAL]);
50 $times[OPEN] += $inbuf[OPEN]; 69 update_times($times[OPEN], $inbuf[OPEN]);
51 $times[LOOP] += $inbuf[LOOP]; 70 update_times($times[LOOP], $inbuf[LOOP]);
52
53 $stddev[TOTAL] += $inbuf[TOTAL] ** 2;
54 $stddev[OPEN] += $inbuf[OPEN] ** 2;
55 $stddev[LOOP] += $inbuf[LOOP] ** 2;
56 } else { 71 } else {
57 while (my $s = shift(@inbuf)) { 72 while (my $s = shift(@inbuf)) {
58 print "$s\n"; 73 print "$s\n";
@@ -60,11 +75,7 @@ sub runtest {
60 die "no timing info\n"; 75 die "no timing info\n";
61 } 76 }
62 } 77 }
63 for (my $i = 0; $i < @times; $i++) { 78 map { $_->[AVG] /= $nsamples; @$_ } @times;
64 $times[$i] /= $nsamples;
65 $stddev[$i] = sqrt($stddev[$i] / $nsamples - $times[$i] ** 2);
66 }
67 return (@times, @stddev);
68} 79}
69 80
70GetOptions( 81GetOptions(

Return to:

Send suggestions and report system problems to the System administrator.