When to use ZippyJSON vs JSONDecoder
masterZippyJSON is designed to optimize JSON parsing performance, which can often be a bottleneck in data delivery.
Decision Guide:
- Default: Start with the standard
JSONDecoderas it is battle-tested. - Profile: If you identify JSON parsing as a performance bottleneck, measure the time taken.
- Estimate: A rule of thumb is to divide the current parsing time by 4 to approximate the time with ZippyJSON.
- Switch: If that difference is significant to your application's user experience, switch to
ZippyJSONDecoder.
Note: If you are targeting iOS 17+, stick with the native JSONDecoder as it is faster than ZippyJSON on that platform.