-improve UDP logging
[oweals/gnunet.git] / src / scalarproduct / perf_scalarproduct.sh
index 35a6d872c6f237b8882cb6b40bae8848e7b584b3..6c7b4ad72b33f88d3e1e08c677daa2c6025a58f1 100755 (executable)
@@ -1,7 +1,18 @@
 #!/bin/bash
-# compute a simple scalar product
-# payload for this test:
-SIZE=1000
+# Computes a simple scalar product, with configurable vector size.
+#
+# Some results (wall-clock for Alice+Bob, single-core, i7):
+# SIZE   2048-H(s)  2048-O(s)    1024-O(s)
+#  25     10          14            3
+#  50     17          21            5
+# 100     32          39            7
+# 200                 77           13
+# 400                149           23
+# 800                304           32
+# Configure benchmark size:
+SIZE=1600
+#
+# Construct input vectors:
 INPUTALICE="-k CCC -e '"
 INPUTBOB="-k CCC -e '"
 for X in `seq 1 $SIZE`
@@ -24,7 +35,8 @@ CFGBOB="-c $PREFIX/1/config"
 # interactive mode would terminate the test immediately
 # because the rest of the script is already in stdin,
 # thus redirecting stdin does not suffice)
-GNUNET_FORCE_LOG=';;;;ERROR'
+#GNUNET_FORCE_LOG=';;;;ERROR'
+#GNUNET_FORCE_LOG='scalarproduct*;;;;DEBUG/cadet-api*;;;;DEBUG'
 GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 &
 PID=$!
 # sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe
@@ -36,6 +48,8 @@ PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB`
 echo "Running problem of size $SIZE"
 gnunet-scalarproduct $CFGBOB $INPUTBOB &
 time RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
+gnunet-statistics $CFGALICE -s core | grep "bytes encrypted"
+gnunet-statistics $CFGBOB -s core | grep "bytes encrypted"
 
 echo "Terminating testbed..."
 # terminate the testbed