viff

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 diff
     1.1 --- a/apps/benchmark.py	Sat Apr 05 00:00:24 2008 +0200
     1.2 +++ b/apps/benchmark.py	Sun Apr 06 16:13:58 2008 +0200
     1.3 @@ -60,7 +60,7 @@
     1.4  from twisted.internet import reactor
     1.5  
     1.6  from viff.field import GF
     1.7 -from viff.runtime import Runtime, create_runtime, gather_shares
     1.8 +from viff.runtime import Runtime, ActiveRuntime, create_runtime, gather_shares
     1.9  from viff.comparison import Toft05Runtime, Toft07Runtime
    1.10  from viff.config import load_config
    1.11  from viff.util import find_prime
    1.12 @@ -90,8 +90,9 @@
    1.13  parser.add_option("-c", "--count", type="int",
    1.14                    help="number of operations")
    1.15  parser.add_option("-o", "--operation", type="choice",
    1.16 -                  choices=["mul", "comp", "compII"],
    1.17 -                  help="operation to benchmark, one of 'mul', 'comp', 'compII'")
    1.18 +                  choices=["mul", "mul-active", "comp", "compII"],
    1.19 +                  help=("operation to benchmark, one of 'mul', 'mul-active', "
    1.20 +                        "'comp', 'compII'"))
    1.21  parser.add_option("-p", "--parallel", action="store_true",
    1.22                    help="execute operations in parallel")
    1.23  parser.add_option("-s", "--sequential", action="store_false", dest="parallel",
    1.24 @@ -192,6 +193,9 @@
    1.25  if options.operation == "mul":
    1.26      operation = operator.mul
    1.27      runtime_class = Runtime
    1.28 +elif options.operation == "mul-active":
    1.29 +    operation = operator.mul
    1.30 +    runtime_class = ActiveRuntime
    1.31  elif options.operation == "comp":
    1.32      operation = operator.ge
    1.33      runtime_class = Toft05Runtime