Hello Hideki,
Few days back you had given me a updated build of cblite phonegap plugin which improved the view performance for android. I reported that it took around 7 seconds initially to index about 150 docs but then it dropped to milliseconds.
Seems like i judged it very early and with only a particular type of docs. I changed my document and added a few more fields to make it little big. I added around 100 docs on a click of button to cblite and then performed a view query. It took around 2.2 - 2.5 seconds for android to index that view first and then return the data. This time interval is very long for the users of my application. Every time i add 100 docs and then query the view, it takes about that much time to return the data.
Now my application involves modules wherein i need to call 2-3 different views after adding about 12 or more docs. Now it takes 400 ms for android to index the view after adding 10 docs (the view which i am talking about here is a simple view with just a emit, no reduce or heavy emit's. If view has a reduce function or some complex emit structure then the above times mentioned are even more higher). So when all my view are called one after another the time adds up and it takes about 5 seconds for my views with reduce function to return data from cblite.
Also there are many other screens which involve calling multiple views and whenever and significant change is made to db, the first query thereafter to all these views take time and when u add up the time it is in seconds.
Speaking from a user perspective i cannot make the user wait for those many seconds every time they create new records and hence the app becomes unusable on android.
Same app on ios indexes views in milliseconds. Even for 100 docs inserted , a view query takes anywhere between 150 ~ 200 milliseconds to index and return data. 2200 ms and 200ms. Thats a difference of 2000 ms between ios and android. You can check the same in your todo lite phonegap app which i have modified to show my stats. I am attaching the source code dropbox folder link here. You can download the app and run tests on it.
I know the performance you get on iOS will not be matched on android due to fundamental differences but what i need to find out that is there any way possible to make performance on android relatively close to iOS if not match it. Can we do something to bring the view indexing time down. Are we doing anything fundamentally wrong while working with cblite ? maybe you can look at the ToDoLite code and help us out somewhere.
I am letting my environment know under which i got the view indexing times
FOR ANDROID
Device - Moto G 1.2 Ghz quad core running android 5.0.2
Ram - 1 gb
view index time for 100 docs - around 2.2 secs
view index time for 10 docs - around 400 ms
FOR IOS
Device - Iphone 5s with ios 7
view index time for 100 docs - around 150ms
view index time for 10 docs - around 20 ms
The cblite plugin used for above test was taken from the below link which u gave earlier.
Awaiting your feedback !
Thanks !