Tuesday, March 03, 2009

Protobuf String serialization

Some of the reasons I heard about choosing XML for protobuf is human readability. Actually protobuf has a human readable string representation, perhaps more readable then XML. The cost of course is time and space, but when testing on low scale where the storage is a relational DB then I use the text representation for debug purposes.
The memory cost is heavy, about 500% more then binary representation and 30% more then java serialization (which tells us something about java serialization).

Note that the numbers may vary according to the object size and the data types it use (numbers/chars). The one I tested with is mostly double, uint32 and sfixed64, which are better represented in binary then text so the 500% is more understood.

0 comments:

Creative Commons License This work by Eishay Smith is licensed under a Creative Commons Attribution 3.0 Unported License.