Browse Source

Update benchmarks to use 1.7.0 Compose version (#5160)

pull/5161/head
Nikita Lipsky 2 months ago committed by GitHub
parent
commit
8c6b24de52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      benchmarks/ios/jvm-vs-kotlin-native/gradle.properties
  2. 4
      benchmarks/ios/jvm-vs-kotlin-native/src/commonMain/kotlin/MeasureComposable.kt
  3. 4
      benchmarks/kn-performance/gradle.properties
  4. 4
      benchmarks/kn-performance/src/commonMain/kotlin/MeasureComposable.kt

4
benchmarks/ios/jvm-vs-kotlin-native/gradle.properties

@ -1,5 +1,5 @@
compose.version=1.6.11
kotlin.version=2.0.0
compose.version=1.7.0
kotlin.version=2.0.20
agp.version=7.0.4
org.gradle.jvmargs=-Xmx3g
compose.desktop.verbose=true

4
benchmarks/ios/jvm-vs-kotlin-native/src/commonMain/kotlin/MeasureComposable.kt

@ -1,7 +1,7 @@
import androidx.compose.runtime.Composable
import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.graphics.asComposeCanvas
import androidx.compose.ui.scene.MultiLayerComposeScene
import androidx.compose.ui.scene.CanvasLayersComposeScene
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.IntSize
import kotlin.time.Duration
@ -18,7 +18,7 @@ fun measureComposable(
frameCount: Int = 1000,
content: @Composable () -> Unit
): Duration {
val scene = MultiLayerComposeScene(size = IntSize(width, height))
val scene = CanvasLayersComposeScene(size = IntSize(width, height))
try {
scene.setContent(content)
val surface = org.jetbrains.skia.Surface.makeNull(width, height)

4
benchmarks/kn-performance/gradle.properties

@ -1,5 +1,5 @@
compose.version=1.6.11
kotlin.version=2.0.0
compose.version=1.7.0
kotlin.version=2.0.20
org.gradle.jvmargs=-Xmx3g
kotlin.native.useEmbeddableCompilerJar=true
compose.desktop.verbose=true

4
benchmarks/kn-performance/src/commonMain/kotlin/MeasureComposable.kt

@ -1,7 +1,7 @@
import androidx.compose.runtime.Composable
import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.graphics.asComposeCanvas
import androidx.compose.ui.scene.MultiLayerComposeScene
import androidx.compose.ui.scene.CanvasLayersComposeScene
import androidx.compose.ui.unit.IntSize
import org.jetbrains.skia.Surface
import kotlin.time.Duration
@ -44,7 +44,7 @@ fun measureComposable(
graphicsContext: GraphicsContext?,
content: @Composable () -> Unit
): BenchmarkResult = runBlocking {
val scene = MultiLayerComposeScene(size = IntSize(width, height))
val scene = CanvasLayersComposeScene(size = IntSize(width, height))
try {
val nanosPerFrame = (1.0 / targetFps.toDouble() * nanosPerSecond).toLong()
scene.setContent(content)

Loading…
Cancel
Save