I have built a social media app similar to instagram using Firebase as my backend, and I have noticed that overall performance of the app declines significantly when i try and perform multiple processes at once.
For example, if i go to the search tab where a bunch of pictures load, and then try and go to my profile page while pictures are still loading on the search page, the information on the profile page loads much slower than if I were to go directly to the profile page.
Is this because the app is running multiple processes at once? If so, how can I introduce adding/removing processes to a queue so that only one process is taking place at a time? Or that certain processes move to the background?
I have paginated the entire app so that only small chunks of data load at a time, and i use an image cache to load images so it is not constantly pulling from the database to reload previously loaded images. I also made sure to dequeue table/collection view cells. I just don't have any experience with threading or DispatchQueue, which is the only thing i can think of to improve performance.
It's difficult to post code because its a lot and there are multiple view controllers, this is more of a theoretical question.