I have a big blf file, blf_file.blf
, and an associated dbc file, dbc_file.dbc
. I need to read and decode all the messages and store them in a list. For this I use the python-can library:
decoded_mess = []
db = cantools.db.load_file('dbc_file.dbc')
with can.BLFReader('blf_file.blf') as can_log:
for msg in can_log:
decoded_mess.append(
db.decode_message(msg.arbitration_id, msg.data)
)
However, for my blf files (> 100 MB), this takes up to 5 minutes.
Is there a way to speed this up? In the end, I want to store every signal in a seperate list, so list comprehension is not an option.