Making News Feed nearly 50% faster on iOS
code.facebook.com
Making News Feed nearly 50% faster on iOS
1–10 of 35 posts
Re: Making News Feed nearly 50% faster on iOS
#2In my own anecdote, we had to show a list of autocompletion items - simple enough. Read XML, write a few hundred entries to a Core Data storage - and this list was relatively static, updated only once a week.
A week after release, we got crash reports - the XML read and store in CoreData was still running while people were already accessing the autocomplete list. It took (IIRC) 10 - 15 seconds to run (on an old iPhone 3GS), which was far too long from any standpoint.
So we just tossed CoreData, stored the list as a simple in-memory list, and made the autocomplete match search a very naive iteration-based search. Ten times faster, if not more.
TL;DR I would avoid CoreData, unless it's relatively static and non-time-critical data. And even then I'd look for alternatives first.
Re: Making News Feed nearly 50% faster on iOS
#3Re: Making News Feed nearly 50% faster on iOS
#4Re: Making News Feed nearly 50% faster on iOS
#5Re: Making News Feed nearly 50% faster on iOS
#6What's up with all the Facebook posts ending up at the top of HN lately?
Re: Making News Feed nearly 50% faster on iOS
#7What's up with all the Facebook posts ending up at the top of HN lately?
Re: Making News Feed nearly 50% faster on iOS
#8I could have told them that. In my previous job I dealt with large JSON data as well but did not use Core Data but went with an immutable data layer as well. If you had to modify anything you had to make a new one. Core Data is fine for things that have to be modifiable and uploaded but if your requirement is mostly read only it's silly overhead.
Re: Making News Feed nearly 50% faster on iOS
#9What bothers me about this industry is that if you were to interview for an iOS position at a place like FB and suggest a KISS type solution, say using PONSOs for the data model, you would immediately be shown the door.
KISS - Keep it simple, stupid
PONSO - Plain ol NSObject
Re: Making News Feed nearly 50% faster on iOS
#10What bothers me about this industry is that if you were to interview for an iOS position at a place like FB and suggest a KISS type solution, say using PONSOs for the data model, you would immediately be shown the door.
A more likely case to the one you're describing would be someone suggesting implementing a search box with an O(N) search through an array (and offering no alternatives), and then being shown out the door.