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.
_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.