Open MathieuDutSik opened 2 days ago
The loading of the views leads to a flurry of independent read_value_bytes which strain the storage. This PR groups the access into a single query.
read_value_bytes
The following was done:
pre_load
post_load
NUM_INIT_KEYS
fn load
Next steps:
try_load_entries_mut
reentrant_collection_view
The CI of the view is already challenging enough and do not need to be expanded.
This should be documented as it is an API change.
Motivation
The loading of the views leads to a flurry of independent
read_value_bytes
which strain the storage. This PR groups the access into a single query.Proposal
The following was done:
pre_load
andpost_load
are introduced.NUM_INIT_KEYS
static variable is introduced because so far the loading leads to a constant number of reads per view.fn load
was changed to use thepre_load
/post_load
.Next steps:
fn load
as a trait function. But we have now 3 kinds of such load functions so maybe the unification is not a good idea.try_load_entries_mut
ofreentrant_collection_view
so that it uses thepre_load
/post_load
.Test Plan
The CI of the view is already challenging enough and do not need to be expanded.
Release Plan
This should be documented as it is an API change.
Links