Fast Lua Serialization

Author summarizes format/library pairings for serializing and deserializing data in Lua. For fastest option, use lua-cbor for pure Lua or lua-protobuf for C library. JSON is widespread but slower; lua-cjson is fastest C library, while lunajson is pure Lua. MessagePack is more bandwidth-efficient than JSON; kieselsteini’s msgpack validates strings as UTF8 or sends them as binary, while fperrad’s lua-MessagePack tags all strings as UTF8. CBOR is best for efficiency, allows customization, flexibility with string formats, and works across Lua versions. Protobufs offer incredible speed but require schema definition. Ultimately, choice depends on speed, interoperability, and complexity of data structures.

https://artemis.sh/2023/02/23/fast-lua-serialization.html

To top