emilk / emilk/egui

Opt-in rusty_alloc feature alongside mimalloc in epaint

Open
#8,499 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

### The value of integrating

egui is currently pulling in mimalloc for allocation; `epaint`'s `Cargo.toml` pins `mimalloc = "^0.1.52"`.

If you added rusty_alloc as a feature, the same allocator would run on native and wasm with no C toolchain and no emscripten. Widgets, painter, eframe, and the public API stay as they are.

Not asking you to swap the default; this would sit behind a feature flag.

### How to integrate

Add it behind an off-by-default Cargo feature in `epaint`, leaving the mimalloc path as it is. Nothing changes for users until they opt in.

```toml
[features]
rusty-alloc = ["dep:rusty_alloc-api"]

[dependencies]
rusty_alloc-api = { version = "1.1.6", optional = true }
```

The rusty_alloc README's call site, in the binary that installs a global allocator:

```rust
use rusty_alloc_api::RustyAlloc;

#[global_allocator]
static ALLOC: RustyAlloc = RustyAlloc;
```

Flip the feature on in CI, compare on your own workloads, and drop the feature with one line if it does not hold up. Your API, tests, and output stay the same.

### Remade With Rust & MATA

We are rebuilding the stack in safe Rust — codecs, parsers, compression, identity, storage — so projects can drop C dependencies without giving up performance. Other crates live at https://github.com/Remade-With-Rust. Close this issue if this is a poor fit.

- x.com/farmer_timmm

Contributor guide

Open the contributing guide

Research direction

Start in epaint/Cargo.toml and inspect its existing mimalloc feature and dependency setup. Read the rusty_alloc README call site, then check the repository's CI configuration for a suitable job to opt into the feature. Done means an off-by-default rusty-alloc feature is available, the existing mimalloc path and public behavior remain unchanged, and CI exercises the opt-in path.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
build-system, performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.