enhance: Limit parallelism for Coil image loading

REF: https://www.reddit.com/r/androiddev/comments/xbeizp/comment/io4ytdv/

Co-authored-by: ivaniskandar <ivaniskandar@users.noreply.github.com>
This commit is contained in:
arkon 2024-07-10 12:10:54 +07:00 committed by Ahmad Ansori Palembani
parent 5785550e75
commit 859674681a
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -54,6 +54,7 @@ import eu.kanade.tachiyomi.util.system.AuthenticatorUtil
import eu.kanade.tachiyomi.util.system.launchIO
import eu.kanade.tachiyomi.util.system.localeContext
import eu.kanade.tachiyomi.util.system.notification
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import org.conscrypt.Conscrypt
@ -263,6 +264,9 @@ open class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.F
if (BuildConfig.DEBUG) {
logger(DebugLogger())
}
fetcherCoroutineContext(Dispatchers.IO.limitedParallelism(8))
decoderCoroutineContext(Dispatchers.IO.limitedParallelism(3))
}
.build()
}