Ideas Lab

Real problems people complain about online, pulled every morning and scored out of 100. Build, validate, or skip. How scoring works

Ideas
4,820
BUILD
702
Sources
8
Last sync
4h ago
328 ideas
Other

RocksDB gets re-compiled on every file change (reason why + workaround)

### Description Hi, I'm using the RocksDB feature, and noticed that RocksDB gets re-compiled on every file change, resulting in 100% of all my CPU cores being used for several minutes, making my system unresponsive. The reason is, that `rust-rocksdb` defaults to using a vendored version of RocksDB (i.e. not using the pre-compiled version, that might be installed on the system), which seems to result in a re-compilation on every file change. `rust-rocksdb` uses the system RocksDB if `ROCKSDB_LIB_DIR` points to the directory where it is installed (`SNAPPY_LIB_DIR` can be used for `snappy`) – however it's not great to have to specify those environment variables always and everywhere (IDE, command line, etc.). My workaround is to define these variables in [.cargo/config.toml](https://doc.rust-lang.org/cargo/reference/config.html): ```toml [env] ROCKSDB_LIB_DIR = "/usr/lib/" SNAPPY_LIB_DIR = "/usr/lib/" ``` Now every Cargo instance that runs within the project directory has `ROCKSDB_LIB_DIR` and `SNAPPY_LIB_DIR` set. I'm opening this issue mostly for visibility / so nobody else has to waste time figuring out what is going on and how to fix it (I couldn't find anything in this repo). Feel free to just close the issue. I'm not closing it myself, in case you want to add the above workaround somewhere to the documentation (which would be the right thing to do, I think). PS: See the following issue for more information: https://github.com/rust-rocksdb/rust-rocksdb/issues/310 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Code of Conduct - [X] I agree to follow this project's Code of Conduct

GitHub3y agoToolOther

28FL score
0Sign in to vote