Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bugfix/tweak

  • Loading branch information...
commit 579ad838aacc0b60098f437dd9e6f0a2a1514471 1 parent 5288fd2
@mackstann authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 bench.py
View
9 bench.py
@@ -14,7 +14,7 @@
minkeys = 2*1000*1000
maxkeys = 40*1000*1000
interval = 2*1000*1000
-best_out_of = 3
+best_out_of = 2
# for the final run, use this:
#minkeys = 2*1000*1000
@@ -43,7 +43,10 @@
proc = subprocess.Popen(['./build/'+program, str(nkeys), benchtype], stdout=subprocess.PIPE)
# wait for the program to fill up memory and spit out its "ready" message
- runtime = float(proc.stdout.readline().strip())
+ try:
+ runtime = float(proc.stdout.readline().strip())
+ except:
+ runtime = 0
ps_proc = subprocess.Popen(['ps up %d | tail -n1' % proc.pid], shell=True, stdout=subprocess.PIPE)
nbytes = int(ps_proc.stdout.read().split()[4]) * 1024
@@ -52,7 +55,7 @@
os.kill(proc.pid, signal.SIGKILL)
proc.wait()
- if nbytes: # otherwise it crashed
+ if nbytes and runtime: # otherwise it crashed
line = ','.join(map(str, [benchtype, nkeys, program, nbytes, "%0.6f" % runtime]))
if runtime < fastest_attempt:
Please sign in to comment.
Something went wrong with that request. Please try again.