AshleyYakeley / Truth

Changes and Pinafore projects. Pull requests not accepted.
https://pinafore.info/
GNU General Public License v2.0
32 stars 0 forks source link

Consider different serialisation #176

Closed AshleyYakeley closed 1 year ago

AshleyYakeley commented 1 year ago

Goals

Options:

(See also #120)

AshleyYakeley commented 1 year ago

I used serial-inspector to compare.

AshleyYakeley commented 1 year ago

Cereal is more predictable, but it has an 8-byte length overhead for lists, including ByteArray, Text, and String.

Serialise has one-byte type information for all simple types. Also converts all numeric types to Integer, then stores them efficiently based on value.

Winery String serialization is inefficient (as [Char]), but Text is fine.

AshleyYakeley commented 1 year ago

Underlying types currently serialised via serialisation library:

Note Void and () are done directly, not via serialisation library.

Maybe, [] etc. are not serialised.

AshleyYakeley commented 1 year ago

Looks like we're doing our own thing here.

AshleyYakeley commented 1 year ago

Done.