Proud Member
Proud Member

Reputation: 40496

Is NSJSONSerialization more error-tolerant and robust than JSONKit?

Although according to benchmarks JSONKit is faster, the Github readme is full of warnings that illformed JSON leads to crashes, etc.

For me it is more important that there is no crash, and that an ilformed Unicode JSON or other subtle error in the JSON file does not cause a crash.

Maybe the speed increase comes from it's strictness and unforgivingness towards errors? Is NSJSONSerialization more robust in this regard?

Upvotes: 4

Views: 1703

Answers (1)

Jeff Wolski
Jeff Wolski

Reputation: 6372

This is a somewhat subjective question in that it can only be answered in terms of the experiences of myself and other developers.

I have used both JSONKit and NSJSONSerialization and greatly prefer the latter. Irrespective of what the benchmarks indicate, I have not noticed a difference in speed in everyday use. However, I am also in the habit of doing my deserialization in a background thread, so the speed differences may not be apparent in the UI.

Upvotes: 2

Related Questions