This project tests different approaches to decoding and measures the performance of each:
- parsing the JSON as a dictionary and iterating over the dictionary
- using Codable
and JSONDecoder
- using Codable
and DictionaryDecoder
- using Protobuf and SwiftProtobug
The script structGeneration.js
will generate random structs (for Codable
, Protobuf
...) to test benchmark different scenarios.
You can edit the parameters describing the depth and width of the payload, and iterate a few times until you have a result you like (the output are random)
node structGeneration.js
Build the app using Release Configuration to a device, hit the Decode
button and wait!