Format Exploration » History » Version 10

Version 9 (J. Moringen, 06/22/2011 08:13 PM) → Version 10/12 (J. Moringen, 07/05/2011 12:54 PM)

h1. Format Exploration

Currently, we use the Google Protocol Buffer library and its message definition format for serializing objects at the framework level. The user may use it for its own datatypes, but is not forced to do so by RSB. However, several alternatives exist which we may additionally evaluate. Afterwards, we could promote (at least internally) the use of one of the alternatives or stick to protobuf.

h2. Serialization Formats and Libraries

* Protocol Buffers: http://code.google.com/p/protobuf/
* MessagePack: http://msgpack.org/
* ROS Wire format: http://www.ros.org (TODO link to specs?)
* LCMs wire format (TODO link to specs?)
* JSON
* Binary JSON: http://bsonspec.org/

h2. Informal Comparison

An informal comparison...

h3. Structure and Types

|_.Aspect |_.Google Protocol Buffers |_.LCM |_.MessagePack |_.ROS MSG |
| Fixed set of fundamental types | yes | ? | yes | yes |
| Nesting | yes | ? | yes | yes |
| Arrays/Sequences | yes | ? | yes | yes |
| - Homogeneous | yes | ? | yes | yes |
| - Inhomogeneous | no | ? | no? | no |
| Enums | yes | ? | yes | no, but constants |
| Nullable types | no | ? | yes | no |
| Optional fields | yes | ? | yes | no |
| Inheritance | no | ? | yes | no |

h3. Description

|_.Aspect |_.Google Protocol Buffers |_.LCM |_.MessagePack |_.ROS MSG |
| Textual IDL | yes, C/Java-like | ? | yes | yes |
| Binary IDL | yes, uses Protocol Buffers | ? | ? | no |
| Self-describing messages | yes, optional | not visible in documentation | ? | yes, by sending textual descriptor |

h3. Serialization

|_.Aspect |_.Google Protocol Buffers |_.LCM |_.MessagePack |_.ROS MSG |
| Random Access without Deserialization | no | ? | ? | no |
| Field Access without Deserialization | yes (by skipping) | ? | ? | yes |
| Parsing of base types in extended msgs| ? | ? | ? | ? |

h3. Non-Functional

|_.Aspect |_.Google Protocol Buffers |_.LCM |_.MessagePack |_.ROS MSG |
| Programming Languages | Java, C++, Python, others community | C, Java, Python, .NET, Matlab | Ruby, C++, Python, Java, others | C++, Python, Java, Common Lisp |
| Extension without recompile | yes | no by design? | ? | ? |
| Speed (Runtime rel. to PBs) | 1 | ? | .25 (claimed) | ? |