Nikita Lipsky 3 days ago committed by GitHub
parent
commit
71e0b05336
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/MeasureComposable.kt

5
benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/MeasureComposable.kt

@ -56,8 +56,11 @@ suspend fun measureComposable(
// warmup // warmup
repeat(warmupCount) { repeat(warmupCount) {
scene.render(canvas, it * nanosPerFrame) scene.render(canvas, it * nanosPerFrame)
surface.flushAndSubmit(false)
} }
graphicsContext?.awaitGPUCompletion()
runGC() runGC()
var renderTime = Duration.ZERO var renderTime = Duration.ZERO
@ -65,8 +68,10 @@ suspend fun measureComposable(
renderTime = measureTime { renderTime = measureTime {
repeat(frameCount) { repeat(frameCount) {
scene.render(canvas, it * nanosPerFrame) scene.render(canvas, it * nanosPerFrame)
surface.flushAndSubmit(false)
} }
} }
graphicsContext?.awaitGPUCompletion()
} }
val frames = MutableList(frameCount) { val frames = MutableList(frameCount) {

Loading…
Cancel
Save