Currently ProposalsState is basically a map from proposal id to (hash vkey, confidence). The problem with this representation is that the hash of the key has to be copied per each proposal. Since we expect to have more participants than proposal we should invert the map.
We should map hash vkey to (proposal id, confidence) to avoid replicating the hash key inside ProposalsState.
Also we should keep an eye on the benchmarks to make sure:
this actually reduces the memory usage.
this doesn't degrade the performance of the currently tallying process.
Currently
ProposalsState
is basically a map fromproposal id
to(hash vkey, confidence)
. The problem with this representation is that the hash of the key has to be copied per each proposal. Since we expect to have more participants than proposal we should invert the map.We should map
hash vkey
to(proposal id, confidence)
to avoid replicating thehash key
insideProposalsState
.Also we should keep an eye on the benchmarks to make sure: