compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

High CPU usage with focused TextField on Linux

Open RocketJannis opened this issue 3 years ago • 2 comments

As long as a TextField is focused on Linux it will consume 100% of one core/thread of my CPU.

This does not occur if a textfield is on the screen but not focused or another window is focused. Also, it does not happen on Windows.

System: amd64 Linux Mint / Cinnamon Compose versions: tested with 1.1.1 but was already there on 1.0.0 beta builds

Also tested on: Fedora / Gnome/Wayland (here it "just" uses 40-60% of one core)

If someone knows how I can provide additional information on this, I would be my pleasure to help :)

RocketJannis avatar Apr 13 '22 13:04 RocketJannis

Wow, so I didn't get to be the first to report it.

The same is happening with me on Ubuntu 22.04 with Compose 1.1.1.

Both TextField and OutlinedTextField have the problem. Once they have focus, the entire UI is very lagging.

                            var lag by remember { mutableStateOf("0") }
                            OutlinedTextField(
                                value = lag,
                                modifier = Modifier.width(100.dp),
                                onValueChange = { lag = it },
                                keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
                                placeholder = { Text(text = "lag") },
                            )

XilinJia avatar Apr 18 '22 10:04 XilinJia

Seems related to #1054, and especially to the comment https://github.com/JetBrains/compose-jb/issues/1054#issuecomment-940964569.

ialokim avatar Aug 30 '22 16:08 ialokim