# HG changeset patch
# User Martin Geisler <[email protected]>
# Date 1229026548 -3600
# Node ID e3c6462fdefd447171e54cbd051833b5637020af
# Parent  419a2fb511aeebbd93f7058979a8a9d665a54e11
New --cpu-burn-in flag for benchmarks.

The idea is to do a local computation in order to "warm up" the VM.

diff --git a/apps/benchmark.py b/apps/benchmark.py
--- a/apps/benchmark.py
+++ b/apps/benchmark.py
@@ -120,6 +120,8 @@
                   help="execute operations in sequence")
 parser.add_option("-f", "--fake", action="store_true",
                   help="skip local computations using fake field elements")
+parser.add_option("--cpu-burn-in", action="store_true",
+                  help="do a CPU burn-in before starting the benchmark")
 
 parser.set_defaults(modulus=2**65, threshold=1, count=10,
                     active=False, twoplayer=False, prss=True,
@@ -154,6 +156,18 @@
 class Benchmark:
 
     def __init__(self, rt, operation):
+
+        if options.cpu_burn_in:
+            print "Starting CPU burn-in:",
+            for i in range(10):
+                print "%d%%" % (i*10),
+                sys.stdout.flush()
+                xs = [Zp(-j) for j in xrange(100000)]
+                ys = [x**2 for x in xs]
+            print "100%"
+            sys.stdout.flush()
+            del xs, ys
+
         self.rt = rt
         self.operation = operation
         self.sync_preprocess()
_______________________________________________
viff-patches mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-patches-viff.dk

Reply via email to