Skip to content

Commit

Permalink
Fix 20s first frame rendering on LazyList benchmark (#5192)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjBooms authored Dec 19, 2024
1 parent 7ddb0a7 commit 71e0b05
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,22 @@ suspend fun measureComposable(
// warmup
repeat(warmupCount) {
scene.render(canvas, it * nanosPerFrame)
surface.flushAndSubmit(false)
}

graphicsContext?.awaitGPUCompletion()

runGC()

var renderTime = Duration.ZERO
if (Args.isModeEnabled(Mode.CPU)) {
renderTime = measureTime {
repeat(frameCount) {
scene.render(canvas, it * nanosPerFrame)
surface.flushAndSubmit(false)
}
}
graphicsContext?.awaitGPUCompletion()
}

val frames = MutableList(frameCount) {
Expand Down

0 comments on commit 71e0b05

Please sign in to comment.