File size: 462 Bytes
0a3edb6 | 1 2 3 4 5 6 7 8 9 10 | import cProfile, glob, pstats, sys, time
from functional import sample, window
from measure import CONFIGS
views = sample(sorted(glob.glob(sys.argv[1])), 150, nudge=True)
opts = CONFIGS["v17 + splitters as ports, big drills"]
t = time.time()
cProfile.run("for r, lab, x0, y0 in views: window(r, lab, x0, y0, opts)", "/tmp/prof.out")
print(f"{(time.time()-t)/len(views)*1000:.0f} ms/window")
pstats.Stats("/tmp/prof.out").sort_stats("cumulative").print_stats(18)
|