I am currently using struct.unpack to read a binary file. Frequently, I would be reading different types of values, so I might read a few longs, then read 8 floats, then read 2 shorts, a couple bytes, etc.
But they are generally grouped nicely so you might get a bunch of longs, and then a bunch of floats, and then a bunch of shorts, etc.
I've read a couple posts about how arrays perform much faster than unpack, but am not sure if there will be a significant difference if I am constantly calling fromfile with different array objects (one for each type I might come across).
Has anyone done any performance tests to compare the two in this situation?