FlatBuffers vs. Protobuf

1,067 views
Skip to first unread message

Arash Pourhabibi-Zarandi

unread,
Feb 4, 2019, 11:09:26 AM2/4/19
to Protocol Buffers

Hi,


My question is if FlatBuffers is much faster than Protobuf, why isn't it more widely used compared to Protobuf?


It used to be an experimental thing but it seems to be mature enough now but isn't widely used yet. It seems people mostly use Flatbuffers for mobile apps/games. Why is that the case?


Arash

Arash Pourhabibi-Zarandi

unread,
Feb 4, 2019, 11:14:37 AM2/4/19
to Protocol Buffers
 I understand the cost of switching to a new framework is high, but the benefit of this is also huge. Companies like Google or Facebook that provide latency-sensitive services gain a lot by doing this. Is there a more fundamental reason discouraging them to switch?

Adam Cozzette

unread,
Feb 4, 2019, 12:21:26 PM2/4/19
to Arash Pourhabibi-Zarandi, Protocol Buffers
It's been a while since I looked closely at FlatBuffers, but from what I understand the performance gains are not entirely free but are something you pay for in the form of a less flexible API. Protocol buffers give you a lot of freedom to mutate messages in memory, cheaply move a submessage from one parent message to another, etc. With FlatBuffers you're much more restricted on how you can mutate a message, and in general you have to build up a message with a depth-first pre-order traversal. It seems that for games and use cases with strict latency requirements it is probably worth dealing with the more restricted API of FlatBuffers (or similar projects like Capn Proto), but for other use cases the performance gains don't justify the extra programming difficulty.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages