-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does flatbuffers serialize empty fields in output as well if it's not specified? #6520
Comments
No, if a field is not set (or if there's a default and its set to the default) then we do not serialize the field.
See #5875 for ideas on further evolution of Flatbuffers. |
Actually you might be referring to the 2byte vtable overhead here. In which case, I guess "yes, a little" is a better answer to the title question. We'd have to change how vtables work to get rid of the overhead: We index into the vtable with the field-id to find the offset to the field's value and if we choose not to write anything when the field is not present, we'd have to do something more complex than indexing and probably would trade away some speed. |
Wondering if total size generated can be lowered if it is able to ignore empty fields and not serialize the "header" key value.
If not, possible to implement in the next version of flatbuffers?
The text was updated successfully, but these errors were encountered: