Zum Inhalt springen
Michael Blaess
IT-Consulting
Michael Blaess
DE

egui or iced? The same music player, built twice in Rust

8 min read RusteguiicedDesktopretro-amp

retro-amp is my own music player, built specifically for the terminal and written in Python.
Terminal applications (TUIs) are nerdy, you have to like that. I am a child of the 80s and love retro computers and retro games.
Not everyone likes TUIs though, so there was supposed to be a second version of retro-amp:
a desktop application that is easy to use. I had run experiments with Qt to keep the original Python code, and looked at Audacity for that as well, because its latest version has been ported to Qt, but I was not happy with the GUIs:
too hard to customize, too slow. So it has become Rust now, with knobs, level meters and a spectrum, the way you know them from music software.

For me the whole thing is an experiment, a playground, and it mainly serves to learn Rust.

retro-amp in the terminal: file tree, cover, level meter and playback buttons
The starting point: retro-amp in the terminal.

The first question was what to draw the interface with. Rust ships nothing of its own for that, the choice of libraries is large, and two names come up most often:
egui and iced. On GitHub the two are almost level, on October 9, 2026 egui had around 31,100 stars and iced around 31,700.

Preview card of the emilk/egui repository on GitHub with contributors, stars and forks Preview card of the iced-rs/iced repository on GitHub with contributors, stars and forks
The preview cards of both repositories on GitHub, as of October 11, 2026.

A third variant with Slint existed as a prototype. It was dropped because of the license: Slint is available under the GPL or under two licenses of its own from the vendor, egui and iced are under MIT.

Instead of deciding by gut feeling, the application now exists in both variants - that allows benchmarking and comparisons of code metrics and code quality. Both versions were built with Claude Code, first the one with egui, then the one with iced.

The egui version during playback: display, spectrum, buttons, knob, levels and track list The iced version during playback, with the same layout
The same interface twice: built with egui first, then with iced. Both images show the same track after nine seconds.

Two philosophies

egui works in what is called immediate mode. That means: the application redraws the entire interface in every frame and asks right there what the user has done. A button is one line of code that draws and, in the same breath, reports whether it was clicked. There is no tree of widgets that lives on between two frames.

iced follows the Elm architecture, named after the programming language Elm. There is a state, a function view that describes the interface from it, and a function update that reacts to messages. A click changes nothing directly, it sends a message.

My analogy: egui is the React, iced the Angular. Anyone who, like me, comes from Textual, the Python framework behind the terminal version, will probably feel at home in iced sooner, because messages and separated responsibilities are familiar from there.

How the comparison is set up

To make sure only the toolkits are compared, everything else lives in a shared core project. The core project decodes the files, plays them, computes the spectrum and reads the track metadata. The control logic sits there too: what “Next”, “Stop” or the end of a track mean is decided by neither of the two interfaces. They only send commands and draw what the core project hands them as state.

pub enum Command {
    Open(PathBuf),
    Select(usize),
    PlayPause,
    Stop,
    Previous,
    Next,
    SeekTo(f32),
    SeekBy(f64),
    SetVolume(f32),
    VolumeBy(f32),
}

The core project knows no toolkit and has 32 tests that run without a window and without audio output.

Both interfaces have the same feature set: a display with scrolling text, a spectrum with 32 bands, five playback buttons, a volume knob, a level meter for left and right, the track list and a progress bar for seeking. The versions used were egui 0.36.2 and iced 0.14.0 with Rust 1.99.

The numbers

egui 0.36.2 iced 0.14.0
Own lines for the interface 1,140 1,681
Size of the finished program 11.0 MB 15.9 MB
Third-party packages in the build 151 222
Build time from scratch 43 s 53 s
Memory when idle 72 MB 143 MB
Memory during playback 95 MB 149 MB
CPU load when idle below 1 % below 1 %
CPU load during playback around 8 % 1.9 %

The measurements were taken on October 10, 2026 on a machine with Windows 11 and a 60 hertz monitor. The CPU load refers to a single core and was determined from the outside over 15 seconds, in two runs each. Work done by the graphics card is not included.

egui needs a third less code, is smaller and gets by with half the memory. iced needs only a quarter of the CPU time during playback.

What the numbers do not show

A comparison based on a single application has limits, and four of them need to be said:

  • The two draw with different technology. egui ran on OpenGL here, iced on wgpu, a graphics layer that sits on top of DirectX or Vulkan under Windows. Size, memory and load therefore do not depend on the toolkit alone. Building egui with wgpu failed with compiler errors in this project, so separating the two is still open.
  • The cause of the higher load in egui has not been found. Limiting it to 30 frames per second did not change the value. So the frame rate alone is not the reason.
  • iced had a template. The second version is a port of the first. The effort for iced probably looks lower than it is because of that.
  • It was one machine with Windows. Linux and macOS were not tested.

Where egui was easier for Claude

  • The mouse comes ready-made. One call tells you, for any area, whether the pointer is over it, whether it was clicked and how far it was dragged. With a hand-drawn knob, all that is left is the drawing. In iced every freely drawn area keeps that state itself.
  • Text can be measured. For scrolling text you need to know how wide the text is. In egui that is one line, the scrolling text has 25 lines there. In iced it took an additional feature of the library and a detour.
  • Long lists. egui creates only the visible rows on request, and drawing each row stays free. In iced the track list is made of ready-made widgets, and the application calculates the visible height itself.
  • Less boilerplate. The state is a single struct, and the buttons change it directly.

Where iced was easier for Claude

  • Arc and gradient are there. The ring around the knob and the gradient bars in the spectrum are one call each in iced. egui had neither, and both now live in 171 lines of my own.
  • Commands can be passed through unchanged. The message of the interface simply carries the command of the core project. That fits so well that the second version needed no logic of its own.
  • Keys are testable. The mapping from key to command is an ordinary function in iced and can be checked without a window. In egui the query is tied to the interface.
  • The file dialog blocks nothing. In iced it runs alongside. In the egui version the interface stands still while it is open. That can be fixed, but it is manual work.
  • Redrawing happens only when needed. In iced that is the default. In egui you have to remember to switch continuous drawing off again yourself.
  • Layout. Rows and columns that share the space, instead of calculating rectangles by hand.

Why I am continuing with egui

What tips the scale is what the player is supposed to become. I want to be able to load skins like the ones known from classic Winamp, meaning interfaces that consist entirely of images. Such an interface is free drawing with click areas, and that is exactly what egui delivers the mouse handling for. On top of that there is a role model: Spotifast, a free Spotify client in Rust, already reads such skins, is built with egui and is under the MIT license. In egui there would be something to learn from, in iced it would be a new development.

The remaining reasons are smaller. egui needed less code for the same result, the program is smaller and easier on memory. On crates.io, the package registry of Rust, egui was downloaded around 6.1 million times in the 90 days before October 9, 2026, iced around 640,000 times. The latest version of egui is from September 8, 2026, that of iced from December 7, 2025.

In return I accept the higher CPU load during playback, for now. Should it turn out that it cannot be lowered and gets in the way in everyday use, that would be a reason for me to reopen the decision.

What I learned from it

The more important decision was not the one for a toolkit, but the one for a core project without an interface. Once the control logic had moved there, the main file of the egui version shrank from 429 to 324 lines, and the iced version only had to draw. Switching the toolkit therefore costs the interface and nothing else.

To anyone facing the same choice, I would therefore recommend this separation first and only then one of the two names. For freely drawn interfaces with a lot of mouse work, quite a bit speaks for egui after this experiment. For applications with a classic layout, many states and the wish for testability, iced is probably the calmer choice.

Sources (checked on October 9 and 10, 2026): egui on GitHub · iced on GitHub · egui on crates.io · iced on crates.io · Spotifast

Planning a similar project?

I support you from consulting and planning through implementation to quality assurance.

“It is not because things are difficult that we do not dare. It is because we do not dare that they are difficult.”

- Seneca