Skip to content

Commit e533420

Browse files
authored
Add usage of jemalloc in op-rbuilder when feature is enabled + improve debug-fast profile (#617)
## 📝 Summary Adding `lto = "thin"` for debug fast profile sped up my build time from 5 min to 4 min Enabled jemalloc in op-rbuilder ## 💡 Motivation and Context <!--- (Optional) Why is this change required? What problem does it solve? Remove this section if not applicable. --> --- ## ✅ I have completed the following steps: * [ ] Run `make lint` * [ ] Run `make test` * [ ] Added tests (if applicable)
1 parent d22c29b commit e533420

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ unarray.opt-level = 3
4040
[profile.debug-fast]
4141
inherits = "release"
4242
debug = true
43+
lto = "thin"
4344

4445
[profile.maxperf]
4546
inherits = "release"

crates/op-rbuilder/src/main.rs

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ mod tester;
2929
mod tx_signer;
3030
use monitor_tx_pool::monitor_tx_pool;
3131

32+
// Prefer jemalloc for performance reasons.
33+
#[cfg(all(feature = "jemalloc", unix))]
34+
#[global_allocator]
35+
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
36+
3237
fn main() {
3338
Cli::<OpChainSpecParser, args::OpRbuilderArgs>::parse()
3439
.run(|builder, builder_args| async move {

0 commit comments

Comments
 (0)