Will using web workers for making AJAX in a hybrid app on Android using cblite cordova plugin improve overall app performance ?

361 views
Skip to first unread message

Vinay Bhinde

unread,
May 11, 2015, 10:09:55 AM5/11/15
to mobile-c...@googlegroups.com
I have built an app using sencha touch mobile framework and CBLite cordova plugin. The app works fine with sync on iOS and Android.

But the performance of app overall (smoothness, UI, ease of use) on iOS is very much high then Android. It runs little bit slowly and is not as smooth as the iOS counterpart.

As i use cordova plugin for cblite it involves a lot of AJAX calls for getting and modified data from the app. In order to improve app performance on Android i was wondering if making all those CBLite ajax calls on a seperate worker thread would help so that the workload on the main UI thread is little less and hence it can perform UI rendering tasks with more ease.

Right now many things such as Dom manipulation, data processing, ajax calls to cblite all occur on the main thread.

I know its less of issue concerning couchbase lite but i just want a general opinion from people that will moving all the network calls for cblite on a seperate thread improve android performance and should i put more efforts into incorporating web worker threads. Also if anyone else has been using worker threads for any similiar task , i would like to know their opinions.

Pros and cons, tips etc will be really helpful.

gaurav...@gmail.com

unread,
May 25, 2015, 6:39:14 AM5/25/15
to mobile-c...@googlegroups.com
We have been thinking of similar approach as well.

Have you got a chance to try this approach ?

Vinay Bhinde

unread,
May 25, 2015, 6:49:20 AM5/25/15
to mobile-c...@googlegroups.com


On Monday, 25 May 2015 16:09:14 UTC+5:30, gaurav...@gmail.com wrote:
We have been thinking of similar approach as well.

Have you got a chance to try this approach ?

No i haven't tried that approach yet. Basically i analysed on my own few points to decide if using worker thread might help and most of the points told me that it wouldn't help much on the performance front if your are not doing any heavy client side data processing after getting the data from cblite. Also the ajax call callbacks are executed on a different thread and not the main thread. Plus the cblite internally already uses threading so there's little that will help us if we go for worker threads.

On a side note if you are using android and you are facing performance issues with phonegap plugin one thing i would recommend is using a modified build of the plugin from the below source. Someone has made changes to the core of cblite and improved view indexing performance by almost 6 times. This might help you because it did help us a lot !

Cheers,
Vinay

Vinay Bhinde

unread,
May 25, 2015, 6:56:25 AM5/25/15
to mobile-c...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages