Reputation: 364
Is there any articles available online where can I find some tips on improving the iPhone application performance. I have read Apple docs on Memory Management and CPU cycles, but they are not very helpful.
Also can someone suggest a few XCode settings that could improve the performance of the application (release version)?
Thanks Jugs
Upvotes: 5
Views: 7705
Reputation: 162712
Short of measuring and optimizing, compiler optimization level is just about the only thing that will impact the performance of your application. Typically, you'll want an optimization level of -Os
; that is, optimized code, but optimized for size, too. Since the iPhone's memory is limited, reducing code size is useful.
Beyond that, you are going to have to measure the performance of your application and react accordingly. There are many tools in Instruments and otherwise to help you in this task. The tools are actually pretty darned good, once you figure them out.
Given that you haven't actually measured anything yet (which is good -- make it work, make it right, make it fast), there may be low hanging fruit. Do you redraw something too often? Have some automatic timed event firing too fast? etc... Just don't fall into the trap of premature optimization; the need to measure & react is paramount to successful optimization.
Note also that you can do coarse grained optimization via the Simulator, but you really need to do the analysis on the app running on the device to do final polish optimization.
(1) Sounds like your database query is really slow. Not knowing the schema, etc, it is hard to know if that is truly the case.
(2) When doing performance analysis and the time is consumed by a function in an unknown library, look up the stack and see what is calling that library to figure out why your app is triggering the performance slowdown.
Upvotes: 8
Reputation: 39376
Best way to improve iPhone performance is to improve app performance, and not just through compiler optimizations, but through better algorithms.
Generally compiler optimizations may improve your performance by some single or two digit percentage. Code optimization using better algorithms, caching, re-architecting, etc. could have a three digit percentage improvement.
I've never found a compiler setting that noticeably improves my app's performance. Your miles may vary.
Upvotes: 2
Reputation: 106187
Basically, what bbum said. Get actual data and go from there. That said, there are a couple compile flags that can have substantial effect:
Upvotes: 2