Open
Description
Python's struct
module seems to be pretty inefficient for our purposes. Namely, in all APIs it provides, it requires passing a format string into unpack
-like function, which then parses that format string in runtime, calls relevant unpack methods, and then constructs a tuple with a single value, which we extract right away.
Actually, struct
even has everything we need — for example, these are functions which read ("unpack") integers, but it's not exposed as Python API.
Would it make sense / be faster to introduce alternative, native Kaitai Struct API which would be written in C, but would be faster than existing one?