ARK-Builders / ark-core

The core of the ARK framework
MIT License
4 stars 3 forks source link

Create a JNI wrapper for Rust's BTreeMap #70

Closed twitu closed 2 months ago

twitu commented 3 months ago

_Originally posted by @kirillt in https://github.com/ARK-Builders/ark-rust/pull/61#discussion_r1632304690_

Currently, the FileStorage JNI bindings perform an expensive conversion to return the whole key-value mapping. However, it can be made more efficient by keeping the BTreeMap on the rust side and exposing functions on it that mimic the relevant operations of a Mapping on the Java side.

Note: We only want to expose read only operations because any write related operations should go through the FileStorage functions.

So methods for getting a value for a key and iterating key value pairs will be a good starting point.