Browse Source

some benchmarking script

Nicolas Winkler 6 years ago
parent
commit
18ad4cb742
1 changed files with 27 additions and 0 deletions
  1. 27 0
      benchmark.py

+ 27 - 0
benchmark.py

@@ -0,0 +1,27 @@
+#!/usr/bin/python
+
+import os
+from timeit import default_timer as timer
+import numpy as np
+from subprocess import check_output
+
+
+nTries = 10
+tries = []
+
+for i in range(1, nTries):
+    start = timer()
+    os.system("./target/release/zombie examples/mandel.bf > /dev/null")
+    end = timer()
+    tries.append((end - start) * 1000)
+
+
+print("benchmark for commit: " + check_output(["git", "rev-parse", "HEAD"]))
+print(str(nTries) + " tries were run")
+print("")
+print("average time [ms]: " + str(np.mean(tries)))
+print("")
+print("max time [ms]:     " + str(np.max(tries)))
+print("min time [ms]:     " + str(np.min(tries)))
+print("variance:          " + str(np.var(tries)))
+