I am trying to reduce the memory size of boost archives in C++.
One problem I have found is that Boost's binary archives default to using 4 bytes for any int, regardless of its magnitude. For this reason, I am getting that an empty boost binary archive takes 62 bytes while an empty text archive takes 40 (text representation of an empty text archive: 22 serialization::archive 14 0 0 1 0 0 0 0 0
).
Is there any way to change this default behavior for ints?
Else, are there any other ways to optimize the size of a binary archive apart from using make_array for vectors?