Skip to content

Commit

Permalink
Benchmarks: fix OOM crash on a real iOS device. (#5209)
Browse files Browse the repository at this point in the history
## Release Notes
N/A
  • Loading branch information
pjBooms authored Jan 22, 2025
1 parent 1e1810c commit b463a44
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,24 @@ suspend fun measureComposable(
repeat(warmupCount) {
scene.render(canvas, it * nanosPerFrame)
surface.flushAndSubmit(false)
graphicsContext?.awaitGPUCompletion()
}

graphicsContext?.awaitGPUCompletion()

runGC()

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

val frames = MutableList(frameCount) {
Expand Down

0 comments on commit b463a44

Please sign in to comment.