On improving performance and avoiding bottlenecks...
Network requests are "expensive" or "slow". They affect performance greatly in iOS. Try combining results and refreshing the UI once multiple requests are finished from background. Good practice is to keep track of each of the asynchronous request and be able to cancel them if needed, to avoid unnecessary consumption of resources.
Efficient memory management is also essential. Avoid retaining large data structs if they are no longer needed. This will relieve memory pressure. Prevent memory leaks.
Optimize UI updates by combining them. UI updates run on main thread. Many UI updates occurring successively can make user interaction with the app unresponsive. Try implementing so called "batch" updates. This is achieved by collecting multiple UI update data from background and then dispatching them on the main thread in larger set time intervals. Utilize data structures by using indexes or sets for more efficient lookup and less render operations.
Use Profiler or other Xcode Instruments for examining slower loads. Measure CPU, memory and network usaage to detect possible optimization areas.
Utilize lazy loading. Load resources on-demand, instead of up-front. Large data set loads can stall the UI. By using lazy-loading, app or view's launch time can significantly be reduced.
Comments
Post a Comment