I have an iOS app with a Couchbase Lite db with 2.219 documents. When the app starts I read all the documents into dictionaries. I do this in a loop document by document because using CB ResultSet takes too much memory. Also toDictionary() seems to have a memory leak.
Anyway. When I first get all document IDs, it takes about 1.5 seconds. Getting all documents after that takes about 19 seconds.
When I do the same thing again later in the running app, getting document IDs takes about 0.15 seconds and getting all documents takes about 4 seconds.
What can I do to speed up the first access to the data?