Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
bump opendbc
  • Loading branch information
deanlee committed Mar 29, 2024
1 parent 69c50e3 commit 2f254fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion opendbc
Submodule opendbc updated 2 files
+1 −0 can/common.h
+8 −0 can/parser.cc
9 changes: 5 additions & 4 deletions selfdrive/debug/check_can_parser_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ class CarModelTestCase(TestCarModelBase):

CC = car.CarControl.new_message()
ets = []
msgs = [[m.as_builder().to_bytes()] for m in tm.can_msgs]
for _ in tqdm(range(N_RUNS)):
for msg in tm.can_msgs:
can_list = can_capnp_to_list([msg.as_builder().to_bytes()])
start_t = time.process_time_ns()
start_t = time.process_time_ns()
for msg in msgs:
can_list = can_capnp_to_list(msg)
for cp in tm.CI.can_parsers:
if cp is not None:
cp.update_strings(can_list)
ets.append((time.process_time_ns() - start_t) * 1e-6)
ets.append((time.process_time_ns() - start_t) * 1e-6)

print(f'{len(tm.can_msgs)} CAN packets, {N_RUNS} runs')
print(f'{np.mean(ets):.2f} mean ms, {max(ets):.2f} max ms, {min(ets):.2f} min ms, {np.std(ets):.2f} std ms')
Expand Down

0 comments on commit 2f254fa

Please sign in to comment.