Take the 2-minute tour ×

I am working on a B2B app that clients will need to download a sizable chunk (504 KB) of JSON data from their servers and then locally process to JSON into core data. It's about 4000 records and it currently takes ~44 seconds to save the parsed JSON data to core data. My issue here is not download speeds or parsing. After this initial download there should not be more than 100 (most likely <10) new records to update. I was planning on having an initial modal screen than pops up when they launch the app and starts processing the request. Is this poor design? Since this is a B2B app our customers will most likely be ok with the initial 45sec load time but is there a more efficient way I can design this?

I have thought about using the JSON data directly as dictionaries and then add the local core data to the tableview as I start saving the core data on a background thread but I haven't attempted to do so yet, is this the route I should take?

share|improve this question
parsing JSON of 504kb should not be a heavy work for iPhone 4 or above. –  Raptor Nov 15 '12 at 16:18
it's not the parsing that's the issue. it's saving the data to CoreData on the backgroud thread that takes 44.5s of the 45s –  mkral Nov 15 '12 at 16:20
Make sure you are using JSONKit as your JSON library on the iOS side. It has been found to yield the best performance. –  chrislhardin Nov 15 '12 at 16:21
Sorry guys, maybe my question is misleading. I am using JSONKit and the downloading/parsing to NSDictionaries is not the issue. My question was should I show a modal view when the core data is being processed which would effectively block the rest of the app until it is complete. Or is there a better way to handle this? –  mkral Nov 15 '12 at 16:23
I had this same issue. Can you post the code you have for parsing it to core data? My issue was that I was saving it to the database after every record, instead of saving the core data as a whole. –  Bot Nov 15 '12 at 17:12

1 Answer 1

up vote 2 down vote accepted

Ok so it was stupid errors by my doing. I was initializing a date formatter every call and on my initial load I was running a fetch on every record to see if it existed (which obviously it doesn't) After removing date formatting I went from 45 secs to 20secs then I went from 20s to 700ms when I removed the fetching.

share|improve this answer

Your Answer


