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 started using Kaitai two years ago when it was still version 0.8. After a long project hiatus I've now upgraded to 0.10 and noticed that the read_bytes(char*, std::streamsize) variant was removed. This is an issue for writing code that tries to avoid excessive memory allocations.
For the binary format I'm reading, Kaitai allocates a lot of small memory blocks and I ran into a "death by a thousand cuts" situation where parsing was extremely slow due to all those allocations. So I wrote a custom type that preallocated memory for certain regions of the file and parsing basically became instant.
Now that the char* variant of read_bytes was removed, I'm back to square one, unfortunately, and I can't avoid allocating memory when reading a block of bytes because I can only receive a new std::string instance as a return value.
Why was this decision made and could this be reversed?
Thank you!
The text was updated successfully, but these errors were encountered:
I started using Kaitai two years ago when it was still version 0.8. After a long project hiatus I've now upgraded to 0.10 and noticed that the
read_bytes(char*, std::streamsize)
variant was removed. This is an issue for writing code that tries to avoid excessive memory allocations.For the binary format I'm reading, Kaitai allocates a lot of small memory blocks and I ran into a "death by a thousand cuts" situation where parsing was extremely slow due to all those allocations. So I wrote a custom type that preallocated memory for certain regions of the file and parsing basically became instant.
Now that the
char*
variant ofread_bytes
was removed, I'm back to square one, unfortunately, and I can't avoid allocating memory when reading a block of bytes because I can only receive a newstd::string
instance as a return value.Why was this decision made and could this be reversed?
Thank you!
The text was updated successfully, but these errors were encountered: