Flatbuffer Intended Use

251 views
Skip to first unread message

Justin Bischoff

unread,
Mar 13, 2015, 1:03:15 PM3/13/15
to flatb...@googlegroups.com
Hello!

I am looking at using Flatbuffers in a small project and wondering about the intended use cases.  When using Protobuffers we would pass around references to the generated message classes and use them as an intermediate representation that we can read or write from.  

However with Flatbuffers it looks like we have Builder classes that are write only and the message classes that are read only.  So as far as I can tell I cannot pass around a single class to both read from and write to.  Am I missing something here?

Thanks,

-Justin

Wouter van Oortmerssen

unread,
Mar 13, 2015, 2:21:27 PM3/13/15
to Justin Bischoff, flatb...@googlegroups.com
No, you are not missing something.

Though FlatBuffers is intended to be universally useful, it was originally designed with typical (mobile) game workloads in mind, loading large amounts of data/assets, or representing scenes, savegames etc. For these use cases, the protobuf parsing and object allocation are undesirable overhead, so FlatBuffers is optimized for being readable with the lowest overhead in cpu / memory usage possible.

FlatBuffers is not intended to be a format to represent your mutable transient data, though we would like to cover this use case in the future. There's multiple ways to do so (with a set of shadow objects, or actual in-place mutation of the FlatBuffer). I'd be happy to discuss those with you further if you're interested.

--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages