Skip to content

Commit fee6cd6

Browse files
committed
Reuse a namespace for the execs
1 parent 1ba8909 commit fee6cd6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Tools/scripts/lazy_marshal_perf.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ def load_helper(data, label, timings, lazy):
3030

3131
def exec_helper(codes, label, timings):
3232
timings["execs"] = []
33+
ns = {}
3334
for i in range(4):
3435
t3 = time.perf_counter()
3536
for code in codes:
36-
exec(code, {})
37+
exec(code, ns)
38+
ns.clear()
3739
t4 = time.perf_counter()
3840
print(f"{label} exec #{i+1}: {t4-t3:.3f}")
3941
timings["execs"].append(t4 - t3)

0 commit comments

Comments
 (0)