Use mimalloc instead of system allocator

This commit is contained in:
Joakim Frostegård 2020-04-06 02:42:23 +02:00
parent d601025286
commit 9d66a5e7d0
4 changed files with 44 additions and 0 deletions

34
Cargo.lock generated
View file

@ -25,6 +25,7 @@ dependencies = [
"bittorrent_udp",
"dashmap",
"indexmap",
"mimalloc",
"mio",
"net2",
"plotly",
@ -96,12 +97,27 @@ version = "1.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
[[package]]
name = "cc"
version = "1.0.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"
[[package]]
name = "cfg-if"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "cmake"
version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81fb25b677f8bf1eb325017cb6bb8452f87969db0fedb4f757b297bee78a7c62"
dependencies = [
"cc",
]
[[package]]
name = "const-random"
version = "0.1.8"
@ -196,6 +212,15 @@ version = "0.2.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0"
[[package]]
name = "libmimalloc-sys"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b87ffa7aa24a1b71beebc6be14ad552d4314ec5be3b3bb3e1159c61a8b01a0bd"
dependencies = [
"cmake",
]
[[package]]
name = "log"
version = "0.4.8"
@ -211,6 +236,15 @@ version = "2.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
[[package]]
name = "mimalloc"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94b16eee4eb86e92abf8ad6910fd3219549ba344d5d77194a6def2119173f2de"
dependencies = [
"libmimalloc-sys",
]
[[package]]
name = "mio"
version = "0.7.0"

View file

@ -21,6 +21,7 @@ name = "plot_pareto"
bittorrent_udp = { path = "../bittorrent_udp" }
dashmap = "3"
indexmap = "1"
mimalloc = "0.1"
net2 = "0.2"
rand_distr = "0.2"
plotly = "0.4"

View file

@ -1,5 +1,10 @@
use aquatic;
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
fn main(){
aquatic::run();
}

View file

@ -13,6 +13,10 @@ mod connect;
mod scrape;
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
fn main(){
connect::bench();