From 04544c15319ff0d393fdaa5986ed5b4c3d490efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 1 Jan 2019 16:27:08 +0100 Subject: [PATCH 1/3] feat: Expose nightly features of some dependencies --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5d19efca3..8664247f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,9 +34,9 @@ rev = "cab857b" [features] default = ["simd"] i128 = ["bincode/i128", "byteorder/i128"] -simd = ["rocksdb/sse"] portable = ["rocksdb/portable"] -nightly = [] +simd = ["rocksdb/sse"] +nightly = ["hashbrown/nightly", "group-by/nightly"] [dev-dependencies] csv = "1.0" From 673102500380754936391ed9f6a356e995a6c15b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 1 Jan 2019 16:27:39 +0100 Subject: [PATCH 2/3] chore: Update group-by --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 8664247f8..eef987228 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ rev = "c2eb140" [dependencies.group-by] git = "https://github.com/Kerollmops/group-by.git" -rev = "cab857b" +rev = "f1f5d8f" [features] default = ["simd"] From b070778d445c102db0bb89e1fdc1ccbcc7adea90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 1 Jan 2019 16:37:15 +0100 Subject: [PATCH 3/3] feat: Use the jemalloc global allocator in examples --- Cargo.toml | 4 ++++ README.md | 5 +++++ examples/create-database.rs | 3 +++ examples/query-database.rs | 3 +++ 4 files changed, 15 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index eef987228..146be05b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,9 +41,13 @@ nightly = ["hashbrown/nightly", "group-by/nightly"] [dev-dependencies] csv = "1.0" elapsed = "0.1" +jemallocator = "0.1" quickcheck = "0.7" rand = "0.6" rand_xorshift = "0.1" structopt = "0.2" tempfile = "3.0" termcolor = "1.0" + +[profile.release] +debug = true diff --git a/README.md b/README.md index e717b02aa..199affe70 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,11 @@ We made some tests on remote machines and found that we can handle with a datase Network is mesured, servers are located in amsterdam and tests are made between two different datacenters. +### Notes + +The default Rust allocator has recently been [changed to use the system allocator](https://github.com/rust-lang/rust/pull/51241/). +We have seen much better performances when [using jemalloc as the global allocator](https://github.com/alexcrichton/jemallocator#documentation). + ## Usage and examples diff --git a/examples/create-database.rs b/examples/create-database.rs index 4f17d54a9..319e04acb 100644 --- a/examples/create-database.rs +++ b/examples/create-database.rs @@ -1,3 +1,6 @@ +#[global_allocator] +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + use std::path::{Path, PathBuf}; use std::error::Error; use std::borrow::Cow; diff --git a/examples/query-database.rs b/examples/query-database.rs index 4571d242e..ce64870a9 100644 --- a/examples/query-database.rs +++ b/examples/query-database.rs @@ -1,3 +1,6 @@ +#[global_allocator] +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + use std::collections::btree_map::{BTreeMap, Entry}; use std::iter::FromIterator; use std::io::{self, Write};