Skip to content

Commit 586e2fa

Browse files
committed
Actually use jemalloc
The uv-performance-memory-allocator is currently optimized out at least on musl due to the crate being otherwise unused (rust-lang/rust#64402), causing musl to not use jemalloc and being slow. Command: ``` cargo build --target x86_64-unknown-linux-musl --profile profiling hyperfine --warmup 1 --runs 10 --prepare "uv venv -p 3.12" "target/x86_64-unknown-linux-musl/profiling/uv pip compile scripts/requirements/airflow.in" ``` Before: ``` Time (mean ± σ): 1.149 s ± 0.013 s [User: 1.498 s, System: 0.433 s] Range (min … max): 1.131 s … 1.173 s 10 runs ``` After: ``` Time (mean ± σ): 552.6 ms ± 4.7 ms [User: 771.7 ms, System: 197.5 ms] Range (min … max): 546.4 ms … 561.6 ms 10 runs ```
1 parent 8ed5ad5 commit 586e2fa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/uv/src/bin/uv.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Don't optimize the alloc crate away due to it being otherwise unused.
2+
// https://github.com/rust-lang/rust/issues/64402
3+
extern crate uv_performance_memory_allocator;
4+
15
use std::process::ExitCode;
26

37
use uv::main as uv_main;

0 commit comments

Comments
 (0)