Reputation: 81
While testing a mobile hybrid app that I had, I noticed that performance on iOS was much worse compared to that of an Android device. Upon further inspection, it appears that IndexedDB was causing the bulk of my issues. I'm also using PouchDB with IndexedDB but the test results here are done in pure IndexedDB.
In a test I did, I created 1 objectStore that contained 1000 rows of simple data (simple key/value pairs). I also open objectStores that contain no documents in increments of 25. when making the stores, I also make sure to call database.close()
in dbRequest.onsuccuess
just in case leaving a store open caused any issues. (not sure i need to though)
The test just runs objectStore.get(key)
1000 times. After removing the top 10 outlying values from each set of data, its complied into this graph.
Performance Chart of different devices using IndexedDB
From this graph, it appears that IndexedDB on iOS 13 has its performance dramatically cut the more objectStores I open at a linear rate. At 150 objectStores for iOS 13 on iPhone Xs Max, I'm recording times of +40ms per objectStore.get(key)
where as on my Android device for the same test, its been a consistent 3ms. Even on iOS 12 running on a iPhone 6, the objectStore.get(key)
is still a consistent 2.5ms. The same trend occurs in PouchDB when I recreate test just with more overhead.
It appears that issue affects both web apps and hybrid mobile apps. Since on iOS 13 devices have this issue as well as my desktop Safari 13. I'm wondering if anyone else has experienced these performance issues on both iOS13 devices and/or Safari 13 or if I'm simply doing something wrong on my end?
edit:
Here's a graph that includes PouchDB's performance which was what sparked my initial investigation. PouchDB took +130ms on iPhone Xs Max for pouchDB.find() to complete and +60ms for Desktop Safari 13.
Performance Chart of Different devices with IndexedDB and PouchDB
Upvotes: 2
Views: 256