android / android/performance-samples
Need examples on how to benchmark suspending functions in microbenchmark
オープン
enhancement
- 主要言語
- Kotlin
- スター
- 1.4k
- フォーク
- 250
- 平均マージ
- 9分
- マージ済み PR(30日)
- 4
説明
Currently, when benchmarking a suspending function, I do the following:
```
val benchmarkRule = BenchmarkRule()
@Test
fun benchmarkSubject() = benchmarkRule.measureRepeated {
runBlocking {
subject.suspendingFunction()
}
}
```
Is this the best way to do it? If so, can there be a helper extension like `benchmarkRule.measureSuspendingRepeated`?
コントリビューションガイド
調査の方向性
まず、issue に示されている既存の BenchmarkRule.measureRepeated と runBlocking の使用方法を確認し、続いてリポジトリ内のマイクロベンチマークの例と関連するテストを見つけます。suspend 関数に推奨されるアプローチを確立し、必要に応じて、想定される使用方法をカバーする helper または例を追加できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- kotlin
- 領域
- performance
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100