mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -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 
This commit is contained in:
@@ -8,6 +8,9 @@ use egui::{Button, Id, RichText, TextureId, Ui, UiBuilder, Vec2};
|
||||
use egui_demo_lib::LOREM_IPSUM_LONG;
|
||||
use rand::Rng as _;
|
||||
|
||||
#[global_allocator]
|
||||
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; // Much faster allocator
|
||||
|
||||
/// Each iteration should be called in their own `Ui` with an intentional id clash,
|
||||
/// to prevent the Context from building a massive map of `WidgetRects` (which would slow the test,
|
||||
/// causing unreliable results).
|
||||
|
||||
Reference in New Issue
Block a user