1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 23:00:04 -04:00

Use mimalloc for benchmarks (#7029)

`mimalloc` is a _much_ faster allocator, especially important when doing
a lot of small allocations (which egui does).

We use `mimalloc` in Rerun, and I recommend everyone to use it.

## The difference it makes

![image](https://github.com/user-attachments/assets/b22e0025-bc5e-4b3c-94e0-74ce46e86f85)
This commit is contained in:
Emil Ernerfeldt
2025-05-06 17:54:06 +02:00
committed by GitHub
parent 5bb20f511e
commit 7216d0e386
9 changed files with 39 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ env_logger = { version = "0.10", default-features = false, features = [
"auto-color",
"humantime",
] }
mimalloc.workspace = true
rfd = { version = "0.15.3", optional = true }
# web:

View File

@@ -4,6 +4,9 @@
#![allow(rustdoc::missing_crate_level_docs)] // it's an example
#![allow(clippy::never_loop)] // False positive
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; // Much faster allocator, can give 20% speedups: https://github.com/emilk/egui/pull/7029
// When compiling natively:
fn main() -> eframe::Result {
for arg in std::env::args().skip(1) {