When you build a native app, all application code typically runs on the main/UI thread by default. When you experience lag, the best way to reduce it is to offload business logic—such as computation and networking—from the main thread to multiple background threads.
Full article