mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-26 01:31:57 -07:00
alloc: use jemalloc when building with musl
It turns out that musl's allocator is slow enough to cause a fairly noticeable performance regression when ripgrep is built as a static binary with musl. We fix this by using jemalloc when building with musl. We continue to use the default system allocator in all other scenarios. Namely, glibc's allocator doesn't noticeably regress performance compared to jemalloc. But we could add more targets to this logic if other system allocators (macOS, Windows) prove to be slow. This wasn't necessary before because rustc recently stopped using jemalloc by default. Fixes #1268
This commit is contained in:
@@ -61,6 +61,9 @@ version = "2.32.0"
|
||||
default-features = false
|
||||
features = ["suggestions"]
|
||||
|
||||
[target.'cfg(target_env = "musl")'.dependencies.jemallocator]
|
||||
version = "0.3.0"
|
||||
|
||||
[build-dependencies]
|
||||
lazy_static = "1.1.0"
|
||||
|
||||
|
Reference in New Issue
Block a user