Download scripts/flow_debug/prof.py from beyarkay/factorio-blueprints: direct link, hf CLI and curl.
- Browser
- Download file 462 Bytes
-
https://huggingface.co/datasets/beyarkay/factorio-blueprints/resolve/main/scripts/flow_debug/prof.py
- Command line
-
hf download hf://datasets/beyarkay/factorio-blueprints/scripts/flow_debug/prof.py
-
curl -L -o prof.py https://huggingface.co/datasets/beyarkay/factorio-blueprints/resolve/main/scripts/flow_debug/prof.py
462 Bytes
| 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) | |