# Chapter 12. Become a performance bugs exterminator

(By Mario Linares-Vásquez)

![](https://22926349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Falpu33fQFigNZbz44g4b%2Fuploads%2Fgit-blob-a2313cfd955de6c6639f19a298ec5dad8a944b6b%2Fnowshad-arefin-484188-unsplash.jpg?alt=media)

_(Free photo by Nowshad Arefin on_ [_Unsplash_](https://unsplash.com/photos/tTHUqB0FNWA)_)_

***

All right... All right... Get ready, because in this chapter you will read about different techniques to avoid, reduce, and get rid of those annoying performance bugs in your mobile apps. Starting from the basics, micro-optimizations (a.k.a., premature optimizations) are prevention-oriented techniques that at runtime could help your app to have better performance (depending on the work-load). Therefore, micro-optimize your app as much as you can. Also, be careful about GUI lags and ANRs, and take advantage of multi-threading; in this chapter we will tell you about the different API classes available for multi-threading. Also, to reduce processing times due to data retrieval you could use caching; thus, in this section we will present you the mechanisms available in both mobile platforms to enable caching. Finally, we will talk about some techniques for reducing the probability of having memory bloats, such as image recycling and using memory efficient structures. Putting all together, you can start your career as a performance bug exterminator.

But before starting, let´s take a quick look to some basic concepts of memory management in both platforms.
