From 0ef8aa27d1e86ef024026fb67e868e05484da241 Mon Sep 17 00:00:00 2001 From: Yongshun Shreck Ye Date: Wed, 27 Nov 2024 10:43:26 +0800 Subject: [PATCH] Benchmark `Dispatchers.Unconfined` in the benchmarks --- .../benchmark/ParameterizedRunBlockingAwaitAsyncsBenchmark.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/integrated/src/benchmarks/kotlin/com/huanshankeji/kotlinx/coroutines/benchmark/ParameterizedRunBlockingAwaitAsyncsBenchmark.kt b/integrated/src/benchmarks/kotlin/com/huanshankeji/kotlinx/coroutines/benchmark/ParameterizedRunBlockingAwaitAsyncsBenchmark.kt index 0df816f..548f16d 100644 --- a/integrated/src/benchmarks/kotlin/com/huanshankeji/kotlinx/coroutines/benchmark/ParameterizedRunBlockingAwaitAsyncsBenchmark.kt +++ b/integrated/src/benchmarks/kotlin/com/huanshankeji/kotlinx/coroutines/benchmark/ParameterizedRunBlockingAwaitAsyncsBenchmark.kt @@ -6,7 +6,7 @@ import kotlinx.coroutines.* class ParameterizedRunBlockingAwaitAsyncsBenchmark : AbstractBenchmark() { enum class DispatcherArgumentEnum { - Default, IO, SingleThread + Default, /*Main,*/ Unconfined, IO, SingleThread } @Param @@ -20,6 +20,8 @@ class ParameterizedRunBlockingAwaitAsyncsBenchmark : AbstractBenchmark() { runBlocking( when (dispatcherArgumentEnum) { DispatcherArgumentEnum.Default -> Dispatchers.Default + //DispatcherArgumentEnum.Main -> Dispatchers.Main + DispatcherArgumentEnum.Unconfined -> Dispatchers.Unconfined DispatcherArgumentEnum.IO -> Dispatchers.IO DispatcherArgumentEnum.SingleThread -> singleThreadContext }