# compose-ios

Henri Gourvest

10/20/2023, 11:01 AM
So, I recorded two videos on Android and IOS that show the difference in motion rendering. The frame rate seems to be lower on IOS, while the other applications are perfectly fluid. I know that Compose IOS is in Alpha, but I'd like to know if this is a problem that's considered important or not. Because for the type of application I want to develop, it's crucial.

Ivan Matkov

10/20/2023, 3:40 PM
Thanks for looking at it! Could you please send a report with reproduction sample here?

Henri Gourvest

10/22/2023, 1:29 PM
I've created a component that eats frames to count them. This had the effect of masking my problem and making the application run perfectly smoothly. Unfortunately, I can't share my code as it is, so I'll try to remove as much code as I can until I completely understand the problem.
Copy code
fun EatFrames() {
    var count by mutableStateOf(0)
    var mark by mutableStateOf(TimeSource.Monotonic.markNow())
    var rate by mutableStateOf(0)
    val textMeasurer = rememberTextMeasurer()
    val precision = 120
    Canvas(Modifier.width(32.dp).height(24.dp).background(Color.Green)) {
        if (count == precision) {
            rate = (1000 * precision / mark.elapsedNow().toLong(DurationUnit.MILLISECONDS)).toInt()
            count = 0
            mark = TimeSource.Monotonic.markNow()
        } else
        drawText(textMeasurer = textMeasurer, text = "$rate")
👍 2
thank you color 2
👍🏻 1