summaryrefslogtreecommitdiffstats
path: root/Cargo.toml
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2019-04-24 17:21:38 -0400
committerAndrew Gallant <jamslam@gmail.com>2019-04-24 17:21:38 -0400
commit03bf37ff4a29361c47843369f7d3dc5689b8fdac (patch)
tree8380de33d3d8f0b5dce6b5cb6b9092f10938278b /Cargo.toml
parente7829c05d3b9234f053e7d480f7e75028831d772 (diff)
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
Diffstat (limited to 'Cargo.toml')
-rw-r--r--Cargo.toml3
1 files changed, 3 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index e93c41a8..d8c68d75 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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"