diff --git a/Cargo.lock b/Cargo.lock index a850d7f..502791c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -275,7 +275,7 @@ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" [[package]] name = "rusty_alloc" -version = "2.2.0" +version = "2.2.1" dependencies = [ "libc", "loom", @@ -286,14 +286,14 @@ dependencies = [ [[package]] name = "rusty_alloc-api" -version = "2.2.0" +version = "2.2.1" dependencies = [ "rusty_alloc", ] [[package]] name = "rusty_alloc-bench" -version = "2.2.0" +version = "2.2.1" dependencies = [ "libloading", "rusty_alloc", @@ -302,14 +302,14 @@ dependencies = [ [[package]] name = "rusty_alloc-ffi" -version = "2.2.0" +version = "2.2.1" dependencies = [ "rusty_alloc", ] [[package]] name = "rusty_alloc-override" -version = "2.2.0" +version = "2.2.1" dependencies = [ "rusty_alloc", "rusty_alloc-ffi", @@ -317,7 +317,7 @@ dependencies = [ [[package]] name = "rusty_alloc-wasm" -version = "2.2.0" +version = "2.2.1" dependencies = [ "rusty_alloc", ] diff --git a/Cargo.toml b/Cargo.toml index 7396d6e..4466d01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,7 +132,7 @@ members = [ # different files that never got the section. Fixed here, in both, and # verified by extracting the packaged `.crate` before publishing rather than # checking the live page afterwards. -version = "2.2.0" +version = "2.2.1" edition = "2024" # MSRV. Declared for the first time in 1.0.1 because this release genuinely # needs it: `asm!` label blocks (`asm_goto`, stable 1.87) carry the free path's diff --git a/README.md b/README.md index 5dbde96..d0a3b69 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,14 @@ does not offer. measured on a XIAO ESP32-S3 at 240 MHz, both allocators built from one source. It costs more RAM to get that (64 KiB vs 8 KiB); both numbers are below. -> **Status: `2.2.0`.** The API is frozen and changes follow semver. 2.0.1 -> through 2.0.5 were patch releases; 2.1.0 and 2.2.0 are minors because they -> ADD public items and move none — `cargo-semver-checks` calls both -> API-compatible. **2.2.0 also carries the largest embedded speed fix in this +> **Status: `2.2.1`.** The API is frozen and changes follow semver. 2.0.1 +> through 2.0.5 and 2.2.1 are patch releases; 2.1.0 and 2.2.0 are minors because +> they ADD public items and move none — `cargo-semver-checks` calls every one +> API-compatible. **2.2.1 is a speed release** (it also adds `malloc_aligned_pow2` and `prim::getenv`, moving nothing): four rounds of exact-instruction +> work (the cross-thread free 32 % cheaper, a 2 MiB allocate-and-free 57 %), +> and a `GlobalAlloc` fast path worth up to 27 % whole-program on Rust +> workloads — see [Performance](#performance-deterministic-instruction-counts). +> **2.2.0 also carries the largest embedded speed fix in this > series:** under `--cfg ra_small_profile` every page was being extended one > block at a time, so `malloc_generic` ran on 100 % of allocations; on a XIAO > ESP32-S3 fixing it is **13–16 % faster on every binned workload**. diff --git a/crates/rusty_alloc/CHANGELOG.md b/crates/rusty_alloc/CHANGELOG.md index 1b7ec6e..6c89ae4 100644 --- a/crates/rusty_alloc/CHANGELOG.md +++ b/crates/rusty_alloc/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.2.1](https://github.com/Remade-With-Rust/rusty_alloc/compare/rusty_alloc-v2.2.0...rusty_alloc-v2.2.1) - 2026-09-25 + ### Fixed - **Growing a huge block with `realloc` copied its whole reservation.** A diff --git a/crates/rusty_alloc_api/CHANGELOG.md b/crates/rusty_alloc_api/CHANGELOG.md index a7f9870..ebd539e 100644 --- a/crates/rusty_alloc_api/CHANGELOG.md +++ b/crates/rusty_alloc_api/CHANGELOG.md @@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.2.1](https://github.com/Remade-With-Rust/rusty_alloc/compare/rusty_alloc-api-v2.2.0...rusty_alloc-api-v2.2.1) - 2026-09-25 + +### Performance + +- **`GlobalAlloc` methods are `#[inline]`**, as the `mimalloc` crate's are, so + rustc's `__rust_alloc` / `__rust_dealloc` shims carry the fast path instead + of jumping to it, and `dealloc` is the free fast path with its null test + folded away. Measured whole-program against 2.2.0 on two deterministic Rust + workloads (`bench/rust-globalalloc.sh`): **-21.1 %** and **-5.8 %**. +- **Layouts aligned up to two words (16 bytes on 64-bit) come from the natural + size classes**, which are already aligned that far, instead of the aligned + path; every hashbrown table is such a layout. `tests/natural_align.rs` pins + the alignment for every size class through alloc, alloc_zeroed and realloc. +- **`realloc` keeps a block in place at any alignment when it fits** instead + of always allocating, copying and freeing above 8 bytes of alignment: + **-27.3 %** on an over-aligned buffer workload. + ## [2.2.0](https://github.com/Remade-With-Rust/rusty_alloc/compare/rusty_alloc-api-v2.1.0...rusty_alloc-api-v2.2.0) - 2026-09-10 ### Other diff --git a/crates/rusty_alloc_api/Cargo.toml b/crates/rusty_alloc_api/Cargo.toml index 83d78e9..7398b54 100644 --- a/crates/rusty_alloc_api/Cargo.toml +++ b/crates/rusty_alloc_api/Cargo.toml @@ -14,7 +14,7 @@ readme = "README.md" [dependencies] # A published crate needs a VERSION alongside the path: the path is what the # workspace builds against, the version is what crates.io resolves. -rusty_alloc = { path = "../rusty_alloc", version = "2.2.0", default-features = false } +rusty_alloc = { path = "../rusty_alloc", version = "2.2.1", default-features = false } [features] # Mirrors the core's (P3, docs/plans/small-metal.md). Default-on, so every