Ido Flax
03/16/2022, 6:46 AMCoroutineScope.launch{ }
takes 40 ms. Isn’t this a bit much? Part of the point of launching is that you don’t need to wait for it, but apparently you do need to wait 40 ms as least
val scope = CoroutineScope(Dispatchers.Default)
println(
measureTimeMillis {
scope.launch { }
}
)
// 40
This is done on a macbook pro 2021 m1 progildor
03/16/2022, 7:27 AMIdo Flax
03/16/2022, 7:34 AMJoffrey
03/16/2022, 7:43 AMDispatchers.Default
actually creates the threads in that poolgildor
03/16/2022, 7:46 AMIdo Flax
03/16/2022, 7:50 AMval scope = CoroutineScope(newFixedThreadPoolContext(1, "test"))
println(
measureTimeMillis {
scope.launch { }
}
)
println(
measureTimeMillis {
scope.launch { }
}
)
println(
measureTimeMillis {
scope.launch { }
}
)
44
22
0gildor
03/16/2022, 7:53 AM