Spike: owned Blockstore
- Dominant language
- Rust
- Stars
- 697
- Forks
- 200
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 65
Description
**Issue summary**
At the moment, the `fvm_ipld_blockstore::Blockstore` trait we are using does not accept owned values in the `put_keyed` method, which conflicts with the ParityDb API, which accepts only owned values. This makes Forest perform additional allocation on every entry write, which is suboptimal.
We could propose changing the trait to accept a [Cow](https://doc.rust-lang.org/std/borrow/enum.Cow.html). Accepting an owned value will most likely not be accepted given the Go FFI does not need to perform any additional allocations. See the [unsafe code](https://github.com/filecoin-project/filecoin-ffi/blob/de34caff946d598edb299566d951b44b9b7f7dd4/rust/src/fvm/blockstore/cgo.rs#L133-L139).
Before doing that, it'd be great to assess if and how it improves performance.
**Other information and links**
Contributor guide
Assessment
This issue has not been assessed yet.