Limit concurrency SysUI bg coroutine dispatcher
This limits the number of threads the systemui bg coroutine dispatcher can use. Before this change, the limit was the max between "kotlinx.coroutines.io.parallelism" and the number of cpus. In sysui we found traces with >40 threads and a lot of thread list lock contention. As the lock contention was also bocking the main thread, it ended up causing jank. The more SysUI switches work to be scheduled in the background, the more jank there would have been. The value of available processor has been identified comparing unbounded, 5 and 10 bg threads. Available processors seem to provide the best values in terms of lock contention and jank. Bug: 322437228 Bug: 321027720 Flag: None as this is fixing a recent regression already in the field. Test: performance tests Change-Id: I5b160fd69b8f3357d582420ef6713ae8cc2a43aa
Loading
Please register or sign in to comment