Optimization: Eliminate double-read when manipulating Option on storage #507
Labels
A-ink_storage
[ink_storage] Work Item
B-research
Research task that has open questions that need to be resolved.
C-discussion
An issue for discussion for a given topic.
When loading an object from storage we have an overhead of one read operation.
See here:
We read the
root_key
two times from storage.At the moment there is no API to ask Seal if a storage is occupied, so instead we have to issue the first read in order to find out if it's
None
orSome(…)
. In the latter case we pull recursively from storage.Possible Solution
We probably have to adapt the
SpreadLayout
interface, since we have to cache those reads ourselves. An option could be to implement caching intoKeyPtr
.The text was updated successfully, but these errors were encountered: