mzaks / FlatBuffersSwift

This project brings FlatBuffers (an efficient cross platform serialization library) to Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add properties of an object in a smaller type first way.

mzaks opened this issue · comments

Now the properties are added in the chronological order. However it would be better to add properties according to there type size. This way we have much better bit packing. And we get better results when we enable fullMemoryAlignment mode.

Wouldn't that break compatibility with the main project?

What this issue implies is that the insert(xxx:toStarrtedObjectAt:) calls should be called for small values first. The index is stable we will only insert small values in the buffer first so that there will be no unneeded padding. The entries in the vTable will stay correct, they will just have different pointers. vTable is what makes FlatBuffers compatible and enables schema evolution.

Ah, I see, nice!