Can I use binary schemas for reducing memory usage?

72 views
Skip to first unread message

Denis Bakhvalov

unread,
Jun 14, 2016, 7:48:07 AM6/14/16
to FlatBuffers
Hi,

On a target device I have lots of configuration files in binary format (generated from JSON using schemas).
Obviously I'm converting JSON to binary to reduce memory usage.

I want to have ability to change some configuration on the fly, i.e. make some changes in JSON file than convert it to binary and feed it to application.
I have flatc deployed on a target machine.

I'm thinking of keeping my schemas also in binary, however I noticed that flatc requires text format (fbs, not bfbs) and size of binary schema is even bigger than text one.

Is there such a use case of binary schemas that can help me here? Or binary schemas are intended to be used for reflection only?

Thanks in advance,
Denis.

Wouter van Oortmerssen

unread,
Jun 15, 2016, 12:23:30 PM6/15/16
to Denis Bakhvalov, FlatBuffers
Yes, currently they are reflection only. We have thought that we should have a way to read a .bfbs back into the parser state, but we haven't gotten around to implementing that yet.

It shouldn't be too hard, it is basically the inverse of the serialization code at the end of idl_parser.cpp, if anyone feels like contributing.

--
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.

Denis Bakhvalov

unread,
Jun 16, 2016, 3:18:34 AM6/16/16
to FlatBuffers, dend...@gmail.com
Got it.
Can binary schemas be used for reducing memory usage?
Currently, I can guess "no". Maybe in future?

среда, 15 июня 2016 г., 18:23:30 UTC+2 пользователь Wouter van Oortmerssen написал:

Wouter van Oortmerssen

unread,
Jun 17, 2016, 12:37:27 PM6/17/16
to Denis Bakhvalov, FlatBuffers
If you're using flatc for conversion, the amount of memory it will use to process JSON using a text or binary schema will pretty much be identical.

If you're thinking disk space, the binary schema example we currently have is actually bigger than text.
Reply all
Reply to author
Forward
0 new messages