performance-samples
performance-samples copied to clipboard
Need examples on how to benchmark suspending functions in microbenchmark
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
?