On 27/06/07, Cliff Green
I don't think binary archives are going to be smaller than the equivalent text archive. native binary archives are built for speed, text for portability, and xml to satisfy those who feel they need it.
I generally agree, but I wouldn't be surprised if binary archives are smaller than text archives for everything but unusual cases. It may not be a significant percentage difference, and of course without some objective test cases I'm just guessing.
FWIW, I'm currently using binary files for some work because the text is huge and slow. For the naiive, punning-to-char* approach, my files go, for example, go down to 1.2 GiB instead of the 2.1 GiB for text, despite storing slightly more data per entry (quaternion instead of euler angles, to be precise). It also makes my load time drop from a few minutes to a few seconds for the smallest of the files (150 MiB of text), which adds up very quickly. Now this is nowhere as general as a proper portable Boost.Serialization-style archive, but I consider it an important usage of a possible binary library, whether that be some sort of boost.endian (to just make what I'm doing port portable), a binary I/O library (as another thread is discussing), or a portable binary archive Boost.Serialization library (which obviously couldn't get as much space reduction, but the speed boost should still be considerable). ~ Scott McMurray