changeset 649:4bd7e5bf4f89

Add ActiveRuntime.mul to the benchmark.
author Martin Geisler <mg@daimi.au.dk>
date Sun, 06 Apr 2008 16:13:58 +0200
parents e6cc20a96ac2
children 7021516d16cf
files apps/benchmark.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/apps/benchmark.py	Sat Apr 05 00:00:24 2008 +0200
+++ b/apps/benchmark.py	Sun Apr 06 16:13:58 2008 +0200
@@ -60,7 +60,7 @@
 from twisted.internet import reactor
 
 from viff.field import GF
-from viff.runtime import Runtime, create_runtime, gather_shares
+from viff.runtime import Runtime, ActiveRuntime, create_runtime, gather_shares
 from viff.comparison import Toft05Runtime, Toft07Runtime
 from viff.config import load_config
 from viff.util import find_prime
@@ -90,8 +90,9 @@
 parser.add_option("-c", "--count", type="int",
                   help="number of operations")
 parser.add_option("-o", "--operation", type="choice",
-                  choices=["mul", "comp", "compII"],
-                  help="operation to benchmark, one of 'mul', 'comp', 'compII'")
+                  choices=["mul", "mul-active", "comp", "compII"],
+                  help=("operation to benchmark, one of 'mul', 'mul-active', "
+                        "'comp', 'compII'"))
 parser.add_option("-p", "--parallel", action="store_true",
                   help="execute operations in parallel")
 parser.add_option("-s", "--sequential", action="store_false", dest="parallel",
@@ -192,6 +193,9 @@
 if options.operation == "mul":
     operation = operator.mul
     runtime_class = Runtime
+elif options.operation == "mul-active":
+    operation = operator.mul
+    runtime_class = ActiveRuntime
 elif options.operation == "comp":
     operation = operator.ge
     runtime_class = Toft05Runtime