[rabbitmq-discuss] Message payload encoding
peter at ohler.com
Sat Jul 30 03:12:25 BST 2011
If you don't mind I will take a shot at that one.
There are a few consideration that should be looked at. It is often the case that message size is not the most significant factor in performance, especially if the message size is small. Consider what it is you are sending. If it is a UTF-8 string then sending the string directly takes no preparation and is smaller than base64 encoding which also incurs and overhead in serialization and deserialization.
If what you are sending is an Java, Python, or Ruby object then there will be significant overhead in the serialization itself. For Ruby I wrote a fast object to XML serializer (Ox gem) that is much faster than the native Marshal encoding and that alone improved performance of our systems significantly.
Something else worth considering besides is how difficult it will be to debug and trace message exchanges. A binary format or base64 requires extra decoding to see what is in the body of a message while UTF-8 strings or XML can be viewed and understood directly. That is a real time saver during development and even in production when trying to fix a problem quickly.
On Jul 30, 2011, at 3:00 AM, Helena Edelson wrote:
> Is there a preference, as in performance or other reason (please specify if so) for a message payload to be encoded for Rabbit as UTF-8 or base64?
> I have been doing UTF-8; just curious.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
More information about the rabbitmq-discuss