Brad
Brad

Reputation: 1148

Websockets over Protocol buffers(protobufs)/binary vs JSON/text performance

Are protobufs sent as binary data over WebSockets faster than JSON sent as text data over WebSockets? As on paper, this seems to be true, even taking into account the small overhead generated by handling bytes on both sides. Did anyone really had a chance to try this and has some concrete results? Thanks!

Upvotes: 13

Views: 8936

Answers (1)

Brad
Brad

Reputation: 1148

So I've made a small project for researching this and I've got some results. You can find the project here, you can find more information in the README and in the results package.

To answer the question; YES, protocol buffers are faster than JSON over 100_000 messages sent as ping pong (no processing over them except marshalling and unmarshalling). But the difference is not as notable as I would have expected.

Upvotes: 17

Related Questions