Skip to content

Commit 7db7880

Browse files
committed
Reduce time spent in heap benchmarking
1 parent b02800f commit 7db7880

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mx.graalpython/live_heap_tracker.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def main():
8383
# Run the benchmark once to ensure pyc files are generated
8484
subprocess.check_call(benchmark)
8585
with open(output_file, 'w') as f:
86+
t0 = time.time()
8687
for _ in range(iterations):
8788
proc = subprocess.Popen(benchmark)
8889
ppid = proc.pid
@@ -91,6 +92,9 @@ def main():
9192
uss_bytes = uss(ppid)
9293
heap_bytes = jmap(jmap_binary, ppid)
9394
f.write(f"{heap_bytes} {uss_bytes}\n")
95+
# cut short if this is a long benchmark
96+
if time.time() - t0 > 30:
97+
break
9498
if proc.returncode != 0:
9599
sys.exit(proc.returncode)
96100

0 commit comments

Comments
 (0)