diff --git a/Cargo.lock b/Cargo.lock index de9e853..9cc6619 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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" diff --git a/aquatic/Cargo.toml b/aquatic/Cargo.toml index 9ee47c0..851f53b 100644 --- a/aquatic/Cargo.toml +++ b/aquatic/Cargo.toml @@ -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" diff --git a/aquatic/src/bin/aquatic.rs b/aquatic/src/bin/aquatic.rs index 834b5b5..943c13e 100644 --- a/aquatic/src/bin/aquatic.rs +++ b/aquatic/src/bin/aquatic.rs @@ -1,5 +1,10 @@ use aquatic; + +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + + fn main(){ aquatic::run(); } \ No newline at end of file diff --git a/aquatic/src/bin/bench_handlers/main.rs b/aquatic/src/bin/bench_handlers/main.rs index 24963c7..80690f4 100644 --- a/aquatic/src/bin/bench_handlers/main.rs +++ b/aquatic/src/bin/bench_handlers/main.rs @@ -13,6 +13,10 @@ mod connect; mod scrape; +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + + fn main(){ connect::bench();