]> Untitled Git - bdk/commit
Disable default features for rocksdb
authorTobin Harding <me@tobin.cc>
Mon, 2 Aug 2021 09:24:44 +0000 (19:24 +1000)
committerTobin Harding <me@tobin.cc>
Wed, 4 Aug 2021 00:22:08 +0000 (10:22 +1000)
commite80be49d1e75e907b6e91049b6a80cf9501c65d0
tree8151789abd8bdb929dcffdb3c4aa8cea1bbd35c3
parentf57c0ca98ed8fe29278c0c34aff44b256c7f11c6
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