iced icon indicating copy to clipboard operation
iced copied to clipboard

High CPU usage after 0.12 when leaving key pressed

Open lufte opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues.

Is this issue related to iced?

  • [X] My hardware is compatible and my graphics drivers are up-to-date.

What happened?

I recently noticed excessive CPU usage in my Iced application when I left a key pressed while writing in a TextInput. I tracked down the introduction of this behavior to the time I upgraded to Iced 0.12, and I was able to strip down my code to a minimal example that exhibits it. It's not related to TextInputs but maybe containers' Appearance.

The example is at https://git.sr.ht/~lufte/vimini/tree/high-cpu-bug. Edit Cargo.toml and src/main.rs to switch between 0.10 and 0.12. All you need to do is run the app and keep any key pressed. I see around 35% usage on my 4-core processor with the 0.12 version.

What is the expected behavior?

Same CPU usage as in 0.10

Version

crates.io release

Operating System

Linux

Do you have any log output?

No response

lufte avatar Jun 12 '24 01:06 lufte

Are we talking release mode here?

hecrj avatar Jun 13 '24 13:06 hecrj

I didn't clarify but yes, release mode in every case.

lufte avatar Jun 13 '24 14:06 lufte

It seems like this may have been fixed in 0.13? Or maybe it is x86 and/or linux/windows specific?

13r0ck avatar Jun 11 '25 01:06 13r0ck

It seems like this may have been fixed in 0.13? Or maybe it is x86 and/or linux/windows specific?

I can still reproduce it in 0.13 but not anymore in master, so I'm closing it. Thanks for the update.

lufte avatar Jun 11 '25 14:06 lufte