I have an android app that fetches a list of about 100 Items.
Trying to get the server load down, I've built a filtering feature that
does everything offline, so basically instead of calling the server (and thus a MySQL query every call)
It filters on its own.
However I've noticed the app tends to lag (while the only change is the offline filtering).
Is the processing of relatively big object-lists something that should be done offline or should I live the load on the server ?
-
1Profile, measure and you will get your answer.Yuriy Zubarev– Yuriy Zubarev2012-08-20 20:25:06 +00:00Commented Aug 20, 2012 at 20:25
-
please, tell me more (i.e. how do I profile?)Asaf– Asaf2012-08-20 20:35:45 +00:00Commented Aug 20, 2012 at 20:35
1 Answer
You cannot know where your problem is unless you profile. Is the lag in the data connection (100 records over mobile might be a slow, the processing at the app, or is the server takling longer to get the data?
If a 100 item list is bogging down the server, I think you might have bigger problems to solve than off loading the filtering work to the devices will help with...... Did you profile the server before you optimized? Perhaps the server is having problems with Bandwidth to the devices - this would make you optimized code have less performance.
As an aside to the original question, I find it hard to believe that there benefit to anyone having a typical Android device do the filtering. The server is sending way more data to the devices than needed, the devices are handling way more data than the need to, and way more data is being sent over the networks. If these are mobile networks, that are often slow, and in some countries, data is expensive. In all countries when roaming, data charges are criminal.
-
Actually the server is not having problems, but I'm planning ahead since we're talking about an app that has been installed a few hundred times, and in a few extra hundreds I might be expecting a slow-down (especially on a shared hosted server)Asaf– Asaf2012-08-21 19:31:09 +00:00Commented Aug 21, 2012 at 19:31
-
Let me get this right - your server is easily handling the workload. You make changes that pass some of that work to a Android Device with 100'th of the processing capability of the server, causing you to send an order of magnitude more data across the network. Then you wonder why the performance has dropped?mattnz– mattnz2012-08-22 22:56:14 +00:00Commented Aug 22, 2012 at 22:56
-
The problem was the iScroll plugin, it was slowing down my application substantiallyAsaf– Asaf2013-02-28 11:26:11 +00:00Commented Feb 28, 2013 at 11:26