Browse Source

Update benchmarks to use 1.7.0 Compose version (#5160)

pull/5161/head
Nikita Lipsky 3 weeks 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 compose.version=1.7.0
kotlin.version=2.0.0 kotlin.version=2.0.20
agp.version=7.0.4 agp.version=7.0.4
org.gradle.jvmargs=-Xmx3g org.gradle.jvmargs=-Xmx3g
compose.desktop.verbose=true 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.runtime.Composable
import androidx.compose.ui.InternalComposeUiApi import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.graphics.asComposeCanvas 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.Constraints
import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.IntSize
import kotlin.time.Duration import kotlin.time.Duration
@ -18,7 +18,7 @@ fun measureComposable(
frameCount: Int = 1000, frameCount: Int = 1000,
content: @Composable () -> Unit content: @Composable () -> Unit
): Duration { ): Duration {
val scene = MultiLayerComposeScene(size = IntSize(width, height)) val scene = CanvasLayersComposeScene(size = IntSize(width, height))
try { try {
scene.setContent(content) scene.setContent(content)
val surface = org.jetbrains.skia.Surface.makeNull(width, height) val surface = org.jetbrains.skia.Surface.makeNull(width, height)

4
benchmarks/kn-performance/gradle.properties

@ -1,5 +1,5 @@
compose.version=1.6.11 compose.version=1.7.0
kotlin.version=2.0.0 kotlin.version=2.0.20
org.gradle.jvmargs=-Xmx3g org.gradle.jvmargs=-Xmx3g
kotlin.native.useEmbeddableCompilerJar=true kotlin.native.useEmbeddableCompilerJar=true
compose.desktop.verbose=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.runtime.Composable
import androidx.compose.ui.InternalComposeUiApi import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.graphics.asComposeCanvas 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 androidx.compose.ui.unit.IntSize
import org.jetbrains.skia.Surface import org.jetbrains.skia.Surface
import kotlin.time.Duration import kotlin.time.Duration
@ -44,7 +44,7 @@ fun measureComposable(
graphicsContext: GraphicsContext?, graphicsContext: GraphicsContext?,
content: @Composable () -> Unit content: @Composable () -> Unit
): BenchmarkResult = runBlocking { ): BenchmarkResult = runBlocking {
val scene = MultiLayerComposeScene(size = IntSize(width, height)) val scene = CanvasLayersComposeScene(size = IntSize(width, height))
try { try {
val nanosPerFrame = (1.0 / targetFps.toDouble() * nanosPerSecond).toLong() val nanosPerFrame = (1.0 / targetFps.toDouble() * nanosPerSecond).toLong()
scene.setContent(content) scene.setContent(content)

Loading…
Cancel
Save