I have a location based social networking app. But it loads a lot slower than other similar apps. It really slows down when loading photos. If I send a photo in a chat window on my app and then the same photo in other similar apps My app takes 10 times longer. But I do not know why
-
6I don't know why either :P – 0x8badf00d Dec 18 '11 at 04:09
-
Perhaps look into image compression before sending photos – ToddBFisher Dec 18 '11 at 04:13
-
1We will obviously need a *lot* more information to be able to answer this question. Without seeing the code, it's going to be basically impossible to debug it. Consider creating a small test application that still reproduces the same behavior, and then editing your question to include that code. It's very likely that this question will be closed as "not a real question", which just means that it's unanswerable as it stands. Closed questions can still be edited to improve them, though, and then they can be re-opened. – Cody Gray - on strike Dec 18 '11 at 04:21
1 Answers
There's no way we can provide a specific answer without knowing specifically what your app does. Fortunately, you don't really need us to tell you why your app is slow; you only need to learn how to figure out for yourself what your app is doing.
Your first step in speeding up your app should be to profile the app using Instruments. Build your app for profiling and run it in Instruments using the Time Profiler tool. Spend some time exercising the part of your app that you want to improve, and then look at the results. You'll be able to see a breakdown of where your app spent time. This should help you understand what your app is doing, and that may help you devise a strategy for speeding up the code. Essentially, you'll want to find ways to do a lot less of whatever the app is spending the most time on. That might mean caching results instead of recomputing or refetching them. It might mean deferring some tasks until the user actually needs them. Or it might mean something else. You won't know until you understand where all that time is going.
Be sure to save the results of that first profiling session. After you make some changes that you think will improve performance, repeat the same test and compare the results to your first results. This should help you confirm that the changes you made really do impact the performance in the way that you thought they would.
Repeat the process for each area that you're concerned about.
A 10x speed differential should be pretty easy to detect. It may be that your competitors spent a lot of time profiling their apps to improve performance, so you may not match them in speed even after you've made all the improvements you can think of, but you should still be able to find some ways to increase performance significantly.

- 124,013
- 19
- 183
- 272
-
3Great advice, but I'm guessing your speaking to a deaf ear. Hopefully not. – one.beat.consumer Dec 18 '11 at 04:29
-
@one.beat.consumer Thanks. Maybe it'll help the OP, maybe not. I think this is a pretty common question, though, so there's a good chance that it'll help other people looking for the same answer in the future. – Caleb Dec 18 '11 at 04:32
-
1I agree this is great advice. Great enough to deserve an upvote... – Cody Gray - on strike Dec 18 '11 at 05:20