Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?

share|improve this question
Profile, measure and you will get your answer. – Yuriy Zubarev Aug 20 '12 at 20:25
please, tell me more (i.e. how do I profile?) – Asaf Aug 20 '12 at 20:35

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.

share|improve this answer
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 Aug 21 '12 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 Aug 22 '12 at 22:56
The problem was the iScroll plugin, it was slowing down my application substantially – Asaf Feb 28 '13 at 11:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.