简体   繁体   中英

iOS - Initial Loading Large Amounts of Data

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM