Repository navigation
Conversation
parsnips
requested review from
LeeroyHannigan,
amrith,
c33howard,
eliseong,
hitesh96db,
jcshepherd,
navareamol,
pdf-amzn and
robinnsc
as code owners
November 11, 2026 04:23
LeeroyHannigan
requested changes
Nov 11, 2026
LeeroyHannigan
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the measurements and the ADR. I read the change against main at 9c3fbfb. Default builds do not change, and the allocator applies only to the bin crate. The CI runs for this PR wait for a maintainer to approve them, so no check has run yet.
A new `mimalloc` feature on the bin crate makes mimalloc the global allocator in place of the system allocator. Default builds do not change. The clippy workflow builds the feature. Measured on the PostgreSQL build of main at 9c3fbfb on glibc, under conditional PutItem and PartiQL INSERT load with 32 requests in flight: with mimalloc, server CPU for each request fell by about 12% and throughput rose by about 2% to 4%. Peak resident memory was higher. ADR-0030 records the measurements and why the feature is off by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: michael parsons <michael@twisp.com>
parsnips
force-pushed
the
feat/mimalloc-allocator
branch
from
November 11, 2026 05:34
82079fe to
83320bb
Compare
LeeroyHannigan
approved these changes
Nov 11, 2026
LeeroyHannigan
left a comment
Collaborator
There was a problem hiding this comment.
I read 83320bb. The clippy run at clippy.yml:39 now builds extenddb/mimalloc, and the comment in main.rs points at ADR-0030. The ADR now measures main at 9c3fbfb. It reports about 12% less server CPU per request and a throughput change close to the noise. It also reports higher peak resident memory with mimalloc. Clippy, with the new feature run, and Licenses pass at this head.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an opt-in
mimallocfeature to the bin crate. With it,mimalloc::MiMallocis the process's#[global_allocator]in place of the system allocator.crates/bin: optionalmimallocdependency, amimalloc = ["dep:mimalloc"]feature, and a#[cfg(feature = "mimalloc")] #[global_allocator]inmain.rs.Cargo.toml:mimalloc = { version = "0.1", default-features = false }in[workspace.dependencies]. The crate'ssecurefeature stays off.docs/adr/0030-optional-mimalloc-allocator.md: the measurements and why the feature is off by default.docs/manuals/04-quickstart-setup-guide.md: the build command..github/workflows/clippy.yml:extenddb/mimallocjoins thetest-hooksclippy run, so CI builds the feature.Default builds do not change.
Why
Closes #953
Measured on the PostgreSQL build of
mainat 9c3fbfb plus this feature only, on glibc 2.36. The load is conditional inserts with unique keys, sent asPutItemwithattribute_not_existsand as PartiQLINSERT, with 32 requests in flight:PutItemPutItemINSERTINSERT* The host also ran other work, which disturbed this window.
perfprofile under thePutItemload,libc.so.6took 16% of the server's samples with glibc malloc and 5% with mimalloc.An earlier revision of this description gave figures from a fork build that carried two unrelated write-path changes (28% of CPU in
libc.so.6, 8.6% more throughput, 23% less CPU). The figures above replace them. The ADR describes the workload and the host.Testing done
cargo fmt --check: clean.cargo build -p extenddbandcargo build -p extenddb --features mimalloc: both build.nmshowsmi_malloc_alignedandmi_freein the feature build only.cargo test -p extenddb --features mimalloc: 3 passed.cargo clippy -p extenddb --features mimalloc -- -W clippy::pedantic -W clippy::unwrap_used -W clippy::expect_used: no new warnings incrates/bin. The two warnings there are missing backticks on doc lines 4 and 10 ofmain.rs, and they are onmaintoo.cargo test --workspace. The library crates and their test binaries do not see the feature, because the allocator is set only in the bin crate.cargo build --release --locked -p extenddbwith and without--features mimalloc, in a Debian 12 container with frame pointers on.Checklist
cargo test --workspace): not run; only the bin crate changes (see above)cargo fmt --check)cargo clippy -- -W clippy::pedantic): no new warnings in the changed crateStoragetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
ADR / RFC: ADR-0030. The number 0030 is the next unused one after the index's 0029. Renumber it if 0028 or another number is reserved.
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.
🤖 Generated with Claude Code