Posted By: Jason
Android and Apple devices are becoming more and more powerful as technology advances, cramming increasingly speedy processors and dizzying amounts of RAM into their thin plastic frames. These forward leaps in computing power don't necessarily mean every piece of software your mobile app development team pushes through the pipeline will perform at peak efficiency though. For those of our readers whose apps aren't performing as well as they'd hoped, here's a short guide to wringing a little extra performance out of them.
If your app has to fetch remote resources regularly, it's crucially important that it doesn't repeat this process, fetching it again and again, each and every time it needs to access it. Caching resources your app regularly uses, such as images which frequently pop up, will significantly boost the speed and responsiveness of your app.
Caching itself is a relatively straightforward process; the first time your app goes out and wrangles a remote resource, it simply stores that information locally, making it available for use later on. Because the resource is cached, it can stream directly off the hard disk next time it is needed, reducing load times. Plus, it can be accessed offline as it's stored locally.
A concept that's well known in development circles, lazy loading works by putting the instantiation of a process or object on hold until it is actually needed. If you've got an object that puts a strain on resources, postponing its instantiation can free up valuable memory, improving app performance, and giving load times a much-needed shot in the arm. What's more, lazy loading is a versatile process, one that can be used across multiple avenues of app development.
Main thread blockage
One of the first things people learn in mobile app development, especially when putting together software for iOS, is to never block the main thread. Doing so will quickly stall your application, causing it be become unresponsive, even crash, as operations get hung up and struggle to complete. If you find your main thread gets clogged easily, start getting into the habit of shunting long running tasks onto a background thread instead.