What’s the size limitation for JSON data payloads for an iPhone app? I’m creating a time entry application and am delivering down to the iPhone app all of the time that has been entered for a week for the iPhone user. The JSON data sizes have been around 15-20 KB for a weeks worth of data (dates, project names, hours by day, etc). Is this too large? What’s a good range size wise for JSON data to be transferred down to iPhone devices?
Thanks
Basically, for the time being, all of the JSON parsing libraries on the iPhone are third-party. There are several of them, so their specific memory limits are going to vary from library to library, but I think any of them should be able to handle 15-20 KB, since any JSON parser that couldn’t handle that much data would be of little use to anyone.
For the record, I have usually used JSONKit with no problem with sizes in the hundreds of kilobytes. In the case where you are downloading the whole JSON file first and then parsing it later, it usually seems to give the best performance.
Regarding memory usage, if, in the future, you find that your JSON files are so big that you can’t parse them, you can also try switching to a streaming parser, which will parse the results as they come in from the network. Some JSON libraries like YAJL support this feature.