Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix performance issues with large binary files
Specifically, pack and unpack PropWords properties with list comprehensions rather than appending each word to a bytes object (creating a new object each time), or to an array. Also use struct.Struct to avoid having to compile the format millions of times. The changes to writing out the dtb make a factor of at least x1000 when writing out a 20Mb file ("at least" because I lost patience). The changes to reading in are much less dramatic - but it's still at least x3. I can read in and write out the 20Mb file in about 1.5s now.
- Loading branch information