I was curious if it is retained or immediate, and how its performance compares to other retained gui libraries such as fltk/fltk-rs as I am looking for something that is retained as I want to make very simple applications with some buttons and dropdowns that do certain things etc?
It’s sort of a mix between retained and immediate. The widget tree gets diffed and rebuilt when needed, so you don’t have to tell it to rebuild manually, but it’s not refreshed continuously if it doesn’t have to.
iced
is basically as fast as you could ever wish it to be. for evidence, just check out the game_of_life
example in --release
mode and crank up the speed to the max…
I think people choose iced
not because it’s faster or slower (it’s faster than basically anything else I’ve tried), but because they like The Elm Architecture and the tradeoffs it makes
I see, sorry I should have been more clear I am actually more concerned about cpu usage over performance. For example when I designed something in egui, it would use 1-2% CPU usage on idle, whereas with fltk-rs it used 0%, even if I was using dropdown menues etc.
Would it also use 0% for a very simple application with some buttons and dropdown menues etc?
There are plenty of examples in the crate displaying the behavior you want. Like I said, iced
is ridiculously fast. Run them on --release
for extra juice.
If you are curious I have a thing I’ve written with both Iced and Fltk-rs. It’s an audio waveform editor so it involves some relatively complex 2d drawing when you are zooming around looking at bits of a long waveform. It’s not a scientific comparison, I’ve only compared it on my old macbook running in debug mode, but I would say Iced performs much better.
With this particular thing. Iced has a very slightly higher base CPU usage (like 8% instead of 2%) when you aren’t doing anything. However once you are doing any kind of drawing Iced uses way less CPU, and redraws at a higher frame rate.
I re-wrote the gui because when trying to take screen recordings of the FLTK based gui using OBS (so I could get sound capture) the performance would rapidly tank, however Iced works well even with OBS on.
This isn’t meant as a slight on FLTK, it gets the job done but, at least in this case, Iced works a lot better.