Allow benchmark allocator features together#21905
Merged
xudong963 merged 1 commit intoapache:mainfrom May 7, 2026
Merged
Conversation
kosiew
requested changes
May 6, 2026
Contributor
kosiew
left a comment
There was a problem hiding this comment.
@xudong963
Thanks for working on this.
I think you need to amend
benchmarks/benches/sql.rs
too.
cargo check -p datafusion-benchmarks --all-targets --all-features
fails with
error: feature "snmalloc" and feature "mimalloc" cannot be enabled at the same time
--> benchmarks/benches/sql.rs:47:1
|
47 | / compile_error!(
48 | | "feature \"snmalloc\" and feature \"mimalloc\" cannot be enabled at the same time"
49 | | );
| |_^
error[E0428]: the name `ALLOC` is defined multiple times
--> benchmarks/benches/sql.rs:57:1
|
53 | static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
| ------------------------------------------------------------ previous definition of the value `ALLOC` here
...
57 | static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
cbca5bf to
041b5f5
Compare
041b5f5 to
00bcac1
Compare
Member
Author
|
@kosiew nice finding, fixed all |
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.
Which issue does this PR close?
Split from #21637.
Rationale for this change
The benchmark binaries currently reject enabling both
snmallocandmimalloc. However, workspace-wide checks such ascargo clippy --all-targets --all-featuresenable both feature flags, which makes these binaries fail before clippy can run.What changes are included in this PR?
This PR removes the explicit compile error from the benchmark binaries and makes allocator selection deterministic:
snmallocis used when enabled, otherwisemimallocis used when enabled.Are these changes tested?
Are there any user-facing changes?
No. This only affects benchmark binary feature combinations used by development checks.