I need to store 20,000 records that are brief (map identifiers to names) and allow the user to search for one either by ID or name in a UISearchBar.
Approach 1 (Core Data): To conserve memory, I tried implementing this with CoreData with SQLite as the backend but found that storing 20,000 records is slow when the initial import is done. Then, as the user types in the UISearchViewBar letter by letter, the response is also noticeably slow.
Approach 2 (NSMutableArray): When I implemented the same thing in memory using NSMutableArray, the response time on the UISearchBar is very quick.
In the first approach, only a small subset of records is in memory at a time but the response time is slow. In the 2nd approach, The 20,000 items take up just 700KB (under a MB) in memory and the response time is fast.
Since Core Data provides persistant storage and makes querying very flexible with predicates, I'd like to use if it possible. Does anyone have suggestions on if there's a way of to still use Coredata but get quicker results?
Thanks