enabled jemalloc as default allocator for now

fuck_this_bullshit
Avril 4 years ago
parent 06c07371ee
commit a724270841
Signed by: flanchan
GPG Key ID: 284488987C31F630

1
.gitignore vendored

@ -1,3 +1,4 @@
/target /target
*~ *~
*.dump *.dump
profiling/

28
Cargo.lock generated

@ -121,6 +121,7 @@ dependencies = [
"async-compression", "async-compression",
"color-eyre", "color-eyre",
"futures", "futures",
"jemallocator",
"lazy_static", "lazy_static",
"libc", "libc",
"memmap", "memmap",
@ -148,6 +149,12 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "fs_extra"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
[[package]] [[package]]
name = "fuchsia-zircon" name = "fuchsia-zircon"
version = "0.3.3" version = "0.3.3"
@ -295,6 +302,27 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "jemalloc-sys"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45"
dependencies = [
"cc",
"fs_extra",
"libc",
]
[[package]]
name = "jemallocator"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69"
dependencies = [
"jemalloc-sys",
"libc",
]
[[package]] [[package]]
name = "kernel32-sys" name = "kernel32-sys"
version = "0.2.2" version = "0.2.2"

@ -13,7 +13,11 @@ codegen-units = 1
panic = "unwind" panic = "unwind"
[features] [features]
default = ["splash", "inspect", "defer-drop"] default = ["splash", "inspect", "defer-drop", "jemalloc"]
# Use jemalloc as global allocator instead of system allocator.
# May potentially cause some speedups and better memory profile on large runs.
jemalloc = ["jemallocator"]
# Use `fallocate()` and memory mapping to save output data instead of normal `write()` syscalls # Use `fallocate()` and memory mapping to save output data instead of normal `write()` syscalls
prealloc = ["inspect", "libc", "memmap"] prealloc = ["inspect", "libc", "memmap"]
@ -31,6 +35,7 @@ splash = []
async-compression = {version = "0.3", features=["tokio-02", "bzip2"], optional=true} async-compression = {version = "0.3", features=["tokio-02", "bzip2"], optional=true}
color-eyre = {version = "0.5.10", default-features=false} color-eyre = {version = "0.5.10", default-features=false}
futures = "0.3.12" futures = "0.3.12"
jemallocator = {version = "0.3.2", optional = true}
lazy_static = "1.4.0" lazy_static = "1.4.0"
libc = {version = "0.2.86", optional = true} libc = {version = "0.2.86", optional = true}
memmap = {version = "0.7.0", optional = true} memmap = {version = "0.7.0", optional = true}

@ -6,6 +6,13 @@
#[cfg(feature="inspect")] use serde::{Serialize, Deserialize}; #[cfg(feature="inspect")] use serde::{Serialize, Deserialize};
#[cfg(feature="jemalloc")]
use jemallocator::Jemalloc;
#[cfg(feature="jemalloc")]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;
use color_eyre::{ use color_eyre::{
eyre::{ eyre::{
self, self,

Loading…
Cancel
Save