-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Benchmark awaiting heavier computations in the benchmarks
Some conclusions: 1. Calling `runBlocking` without a `CoroutineContext` should be equivalent to calling it with `Dispatchers.Unconfined`, both of which run on the original single thread of the caller. 1. Awaiting empty `async`s is dependent on single-core performance. 1. Both `Dispatchers.Default` and `Dispatchers.IO` utilize all the cores for computation. 1. `await` is much heavier on `Dispatchers.IO`. 1. `await` is lightest when calling `runBlocking` without a `CoroutineContext` or on `Dispatchers.Unconfined`.
- Loading branch information
Showing
5 changed files
with
45 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
.../com/huanshankeji/kotlinx/coroutines/benchmark/AbstractRunBlockingAwaitAsyncsBenchmark.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.huanshankeji.kotlinx.coroutines.benchmark | ||
|
||
abstract class AbstractRunBlockingAwaitAsyncsBenchmark : AbstractBenchmark() { | ||
abstract fun runBlockingAwait1mAsyncs() | ||
|
||
abstract fun runBlockingAwait1KAsync1mSums() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters