f9fcc7adab
date: 2026-06-28T09:48:35 master commit: da6313dbe95b3f24bb5d8018b0e5f950f5823ca7
17 lines
562 B
Python
17 lines
562 B
Python
import sys, pickle
|
|
from extra.bench_log import WallTimeEvent, BenchEvent
|
|
from tinygrad.helpers import getenv
|
|
|
|
PKL = sys.argv[1] if len(sys.argv) > 1 else "/tmp/openpilot.pkl"
|
|
|
|
load_times = []
|
|
|
|
for _ in range(10):
|
|
with WallTimeEvent(BenchEvent.STEP) as wte: pickle.load(open(PKL, 'rb'))
|
|
load_times.append(wte.time)
|
|
print(f"pickle load: {wte.time:6.2f} s")
|
|
|
|
if (assert_time:=getenv("ASSERT_MIN_LOAD_TIME")):
|
|
min_time = min(load_times)
|
|
assert min_time < assert_time, f"Speed regression, expected min load time of < {assert_time} s but took: {min_time} s"
|