From e80be49d1e75e907b6e91049b6a80cf9501c65d0 Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Mon, 2 Aug 2021 19:24:44 +1000 Subject: [PATCH] Disable default features for rocksdb In an effort to reduce the build times of `rocksdb` we can set `default-features` to false. Please note, the build speed up is minimil With default features: ``` cargo check --features compact_filters 890.91s user 47.62s system 352% cpu 4:26.55 total ``` Without default features: ``` cargo check --features compact_filters 827.07s user 47.63s system 352% cpu 4:08.39 total ``` Enable `snappy` since it seems like this is the current default compression algorithm, therefore this patch (hopefully) makes no changes to the usage of the `rocksdb` library in `bdk`. From the `rocksdb` code: ``` /// Sets the compression algorithm that will be used for compressing blocks. /// /// Default: `DBCompressionType::Snappy` (`DBCompressionType::None` if /// snappy feature is not enabled). /// /// # Examples /// /// ``` /// use rocksdb::{Options, DBCompressionType}; /// /// let mut opts = Options::default(); /// opts.set_compression_type(DBCompressionType::Snappy); /// ``` pub fn set_compression_type(&mut self, t: DBCompressionType) { .... ``` --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fd3c5a91..140f844b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ reqwest = { version = "0.11", optional = true, features = ["json"] } ureq = { version = "2.1", default-features = false, features = ["json"], optional = true } futures = { version = "0.3", optional = true } async-trait = { version = "0.1", optional = true } -rocksdb = { version = "0.14", optional = true } +rocksdb = { version = "0.14", default-features = false, fetures = ["snappy"], optional = true } cc = { version = ">=1.0.64", optional = true } socks = { version = "0.3", optional = true } lazy_static = { version = "1.4", optional = true }