Hi, i've recently been involved in a project requiring a pretty good level of performance regarding serialization (to & from local storage), and found myself stuck between a few walls trying to use swift :
use a DB mapping each property of my data to a column (with or without an ORM like core data). This is nice, but becomes very cumbersome very quickly if the number of different properties or the complexity of your models becomes too large.
serialize my struct & classe to a "data" blob, and persist it on a file (either in a BLOB DB column, or directly in a file).
The second option lead me to try various serialization formats, from json to binary plist, to flatbuffer, to protobufs, and they seem to fall into two categories:
1- Map pretty conveniently with the Swift types & protocols (codable) and are convenient to use, but are way too slow by at least 2 orders of magnitude (taking seconds instead of tens of milliseconds on other platforms), like json & property lists. OR
2- are fast, but requires a lot of plumbing code to map to the wide range of swift types (eg: enums), with each mapping layer adding the risk of a mistake or a performance penalty. (flatbuffers & protobufs)
Are there any plan to add a high performance serialization tool in the stdlib that would map pretty decently with the rest of the library ?