Live data from Hacker News

Making News Feed nearly 50% faster on iOS

code.facebook.com

1–10 of 35 posts

Re: Making News Feed nearly 50% faster on iOS

#2
I really hope Apple will come up with a modern alternative to Core Data; it's neat and all, but it just doesn't feel like it's a good match for most situations.

In 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

#3
I 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

#8
post #3

I 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.

I am pretty confident this is how Twitter manage data on their iOS app as well, and I'm also pretty sure they went through a similar "let's use a database/ORM, actually let's just write it to disk" process.

Re: Making News Feed nearly 50% faster on iOS

#9

What 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.

Since I had to look it up and I doubt I'm alone:

KISS - Keep it simple, stupid

PONSO - Plain ol NSObject

Re: Making News Feed nearly 50% faster on iOS

#10

What 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 great interviewer wouldn't be hung up on the "officially correct" way, but would instead expect the person to be aware of the different solutions and chat about the trade-offs.

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.

Post reply on HN