4

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?

Proud Member
  • 40,078
  • 47
  • 146
  • 231
  • What do you mean by "illformed"? Are you suggesting an IE 6 approach to JSON? Or do you mean able to recover from some invalid characters? – borrrden May 21 '12 at 09:52
  • I mean for example when there's a UTF8 error, a broken character, etc. – Proud Member May 21 '12 at 10:05
  • Not sure on that one, but JSONKit states that it will replace invalid characters with the UTF-8 replacement character as per the UTF standard. Every other warning that JSONKit gives about invalid values, etc seems to be the exact same as NSJSONSerialization. – borrrden May 21 '12 at 14:05

1 Answers1

2

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.

Jeff Wolski
  • 6,332
  • 6
  • 37
  • 69