You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to parse a binary file format which is made up of packets. I have figured out the packet grammar, and if I have a file with the stream saved in it I can parse all packets from it. But this is incredibly slow as each file can be several GBs long. To speed it up I was wondering if I can only parse specific packets selected by their ID which is right at the top of the structure. A minimum example of a packet would look like this
MAGIC NUM
ID: ID1
DATA1: VALUE 1
DATA2: VALUE 2
I want to parse till ID and then decide if I want to parse any further.
One approach I tried was to write a header parser. But the problem is since I don't know the size of the packets, I end up writing a negative look ahead for the magic number. This is equally as slow as just parsing the struct (this does feel like one of those good problems doesn't it :P).
The text was updated successfully, but these errors were encountered:
I am trying to parse a binary file format which is made up of packets. I have figured out the packet grammar, and if I have a file with the stream saved in it I can parse all packets from it. But this is incredibly slow as each file can be several GBs long. To speed it up I was wondering if I can only parse specific packets selected by their ID which is right at the top of the structure. A minimum example of a packet would look like this
MAGIC NUM
ID: ID1
DATA1: VALUE 1
DATA2: VALUE 2
I want to parse till ID and then decide if I want to parse any further.
One approach I tried was to write a header parser. But the problem is since I don't know the size of the packets, I end up writing a negative look ahead for the magic number. This is equally as slow as just parsing the struct (this does feel like one of those good problems doesn't it :P).
The text was updated successfully, but these errors were encountered: