There is
never a good reason to block the main thread. It is not conceivable that what you want to achieve cannot be done asynchronously or even in parallel to the main thread. You can ask a new question if you want to learn more how your current approach can be refactored accordingly.
Code Review might also be a good fit for that. -- However,
runBlocking
is not the cause of your current problem. The code you shared should execute the configurators in parallel, speeding the total time up. Please add a
minimal reproducible example that we can actually execute so we can see what the real culprit is. —
tyg 44 secs ago