As developers, we're always on the lookout for efficient ways to build GUI applications. In this post, we'll be diving into the world of Rust-based GUI frameworks, comparing the performance of three popular libraries: Tauri, Iced, and Egui.

When it comes to building a snappy UI experience, speed is key. That's why we've put these libraries through their paces, testing startup time, input lag, and resize performance on our machine. In this article, we'll explore the results of our tests and provide insights into what each library has to offer.

Key Takeaways

All three libraries are likely fast enough for most cases, but Tauri falls slightly behind Iced and Egui in terms of startup time and resize performance.

Introduction

Before we dive into the nitty-gritty details, let's give you a brief overview of each library:

  • Tauri: Uses the webview by the OS to render an HTML/JS frontend. You can choose any frontend framework (JS or Rust). The "backend" is written in Rust and communicates with the frontend via built-in methods.
  • Iced: An Elm-inspired, reactive GUI library that uses wgpu for rendering on desktop and has an experimental web backend to create a DOM for rendering. All code is written in Rust.
  • Egui: An immediate mode GUI using OpenGL for custom rendering. All code is written in Rust.

Comparison

Here's a breakdown of each library's statistics:

| Library | GitHub Stars | Crates.io Downloads (Recent/All-Time) |

| --- | --- | --- |

| Tauri | 60k | 145k / 485k |

| Iced | 18k | 30k / 180k |

| Egui | 13k | 135k / 600k |

Architecture & Implementation

Here's a look at each library's architecture and implementation:

| Library | Programming Model | Desktop | Web |

| --- | --- | --- | --- |

| Tauri | Depends on chosen frontend framework | via OS webview | not built-in, manual setup possible |

| Iced | Elm-like/reactive | wgpu-based | experimental, via iced_web |

| Egui | Immediate mode | backend-agnostic, default backend is OpenGL-based | via WebGL |

Performance

We tested each library's performance on our machine, using the following metrics:

  • Startup time: The time it takes for the application to render its initial UI.
  • Input delay: The time it takes for the application to respond to user input (in frames).
  • Resize: The performance of the application when resizing its window.

Here are the results:

| Library | Startup Time (ms) | Input Delay (frames) | Resize Performance |

| --- | --- | --- | --- |

| Tauri | 380 | 2-3 | 10-15fps |

| Iced | 230 | 3 | 12-30fps |

| Egui | 280 | 2 | 12-30fps |

Methodology

We used the following methodology to test each library's performance:

  • We recorded the full screen with OBS and counted frames in Avidemux.
  • We tested each library using minimal examples, as well as more complex applications like Sublime Text and VS Code.

By comparing the performance of these three Rust-based GUI frameworks, we hope to provide valuable insights for developers looking to build their own GUI applications. Whether you're building a simple desktop app or a complex editor, understanding the strengths and weaknesses of each library can help you make informed decisions about which one to use in your project.