Skip to content

Conversation

@madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Nov 13, 2025

Fixes the performance regression introduced in #146627.

This effectively reverts 65f0b7a (second commit in that PR), and adds a comment explaining why extern crate is needed here instead of use (we need to load tikv_jemalloc_sys from the sysroot for some reason).

r? Kobzol

@madsmtm madsmtm added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 13, 2025
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. labels Nov 13, 2025
@madsmtm
Copy link
Contributor Author

madsmtm commented Nov 13, 2025

I could reproduce the performance regression locally, let's see if rustc-perf agrees:

@bors try
@rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 13, 2025
Fix performance regression with jemalloc
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 13, 2025
@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Nov 14, 2025

☀️ Try build successful (CI)
Build commit: f30bc23 (f30bc23f4189bac695183835d28078b38cf28d74, parent: 2286e5d224b3413484cf4f398a9f078487e7b49d)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f30bc23): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
3.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
1.2% [0.2%, 1.5%] 8
Improvements ✅
(primary)
-2.1% [-3.4%, -1.1%] 20
Improvements ✅
(secondary)
-1.4% [-2.7%, -0.2%] 25
All ❌✅ (primary) -1.9% [-3.4%, 3.1%] 21

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (primary -1.7%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-2.5% [-3.2%, -2.1%] 6
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) -1.7% [-3.2%, 2.6%] 7

Binary size

Results (primary 1.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 1

Bootstrap: 474.605s -> 473.65s (-0.20%)
Artifact size: 388.41 MiB -> 388.64 MiB (0.06%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 14, 2025
Using the new `override_allocator_on_supported_platforms` feature in
`tikv-jemalloc-sys v0.6.1` we can avoid the manual statics.
@madsmtm
Copy link
Contributor Author

madsmtm commented Nov 14, 2025

@bors try
@rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

rust-bors bot added a commit that referenced this pull request Nov 14, 2025
Fix performance regression with jemalloc
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 14, 2025
@rust-bors
Copy link

rust-bors bot commented Nov 14, 2025

☀️ Try build successful (CI)
Build commit: aef7be6 (aef7be6c425e18433bd4afc8a6ffcccfe9ffe796, parent: 7a72c5459dd58f81b0e1a0e5436d145485889375)

@rust-timer
Copy link
Collaborator

Queued aef7be6 with parent 7a72c54, future comparison URL.
There are currently 0 preceding artifacts in the queue.
It will probably take at least ~1.3 hours until the benchmark run finishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants