-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnormal_score.py
More file actions
23 lines (23 loc) · 786 Bytes
/
normal_score.py
File metadata and controls
23 lines (23 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import subprocess
import os
os.system("sync")
os.system(" echo 3 > /proc/sys/vm/drop_caches")
scores=[]
ITERS=10
for i in range(0,ITERS):
p = subprocess.Popen("perf stat java -jar -Xms2024m -Xmx2024m -Xmn1024m normalization.jar", shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
for line in iter(p.stdout.readline, 'b'):
# for line in p.stdout.readlines():
line = line.decode().strip()
if "seconds time elapsed" in line:
scores.append(float(line.split(' ')[0]) * 1000)
break
max_time=max(scores)
min_time=min(scores)
avg_time=(sum(scores)-max_time-min_time)/8.0
print("ITERS:",ITERS)
print("max_time:",max_time)
print("min_time:",min_time)
print("avg_time:",avg_time)